setup.py: simplify test command

This commit is contained in:
Benjamin Dauvergne 2013-10-08 11:24:17 +02:00
parent fc8768d123
commit d3efa2fca8
1 changed files with 1 additions and 8 deletions

View File

@ -18,14 +18,7 @@ class TestCommand(Command):
'''
Finds all the tests modules in tests/, and runs them.
'''
testfiles = [ ]
for t in glob(pjoin(self._dir, 'tests', '*.py')):
if not t.endswith('__init__.py'):
testfiles.append('.'.join(
['tests', splitext(basename(t))[0]])
)
tests = TestLoader().loadTestsFromNames(testfiles)
tests = TestLoader().loadTestsFromName('tests.api')
t = TextTestRunner(verbosity = 1)
t.run(tests)