diff options
author | pab <devnull@localhost> | 2009-05-24 16:12:43 +0000 |
---|---|---|
committer | pab <devnull@localhost> | 2009-05-24 16:12:43 +0000 |
commit | b4c2cf9bce9be0a63681440e4d5b8fc245e107e3 (patch) | |
tree | 73bad4f33a26d1405b66d5304afe48400a7ce641 /setup.py | |
parent | 74867ccd570baade2d41d7c75e700149caf3076b (diff) |
Use the name of the test instead of a random number, so we can see which tests fail
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -64,12 +64,18 @@ class test (Command): # cases in it to a complete suite. loader = unittest.defaultTestLoader suite = unittest.TestSuite() + used_names = set() for fn in tests: stage = 'compile' try: # Assign a unique name for this test - test_name = 'test%d' % (number,) - number += 1 + test_name = os.path.basename(fn).split('.')[0] + test_name = test_name.replace('-', '_') + number = 2 + base_name = test_name + while test_name in used_names: + test_name = '%s%d' % (base_name, number) + number += 1 # Read the test source in and compile it rv = compile(file(fn).read(), test_name, 'exec') |