Skip to content

Commit 91c45a7

Browse files
committed
Improve test -n and -p failure messages
1 parent 2fc4d64 commit 91c45a7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,14 +1223,14 @@ def __getitem__(self, key):
12231223
def test_known(string):
12241224
i = int(string)
12251225
if i >= 0 and i < len(TESTS) : return i
1226-
else : raise ArgumentTypeError("{0} does not index a test".format(i))
1226+
else : raise ArgumentTypeError("{0} does not index a test. The accepted range is 0 to {1}".format(i, len(TEST_MAP) - 1))
12271227

12281228
def test_name_known(string):
12291229
nlist = string.split(',')
12301230
for test_id in nlist:
12311231
if test_id not in TEST_MAP.keys():
12321232
if getattr(ps, "test_alias", None) is None or \
12331233
ps.test_alias.get(test_id, "") not in TEST_MAP.keys():
1234-
raise ArgumentTypeError("Program with name '%s' not found"% test_id)
1234+
raise ArgumentTypeError("Program with name '{0}' not found. Supported tests are {1}".format(test_id, ", ".join(TEST_MAP.keys())))
12351235

12361236
return [TEST_MAP[n].n for n in nlist]

0 commit comments

Comments
 (0)