Skip to content

Commit

Permalink
Fix 'python setup.py test'
Browse files Browse the repository at this point in the history
  • Loading branch information
florentx committed Mar 2, 2013
1 parent 7b590ad commit e3e240c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -13,7 +13,7 @@ script:
- python pep8.py --testsuite testsuite
- python pep8.py --statistics pep8.py
- python pep8.py --doctest
- python -m testsuite.test_all
- python setup.py test
matrix:
allow_failures:
- python: pypy
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -52,5 +52,5 @@ def get_long_description():
'Programming Language :: Python :: 3',
'Topic :: Software Development :: Libraries :: Python Modules',
],
test_suite='testsuite.test_all',
test_suite='testsuite.test_all.suite',
)
11 changes: 7 additions & 4 deletions testsuite/test_all.py
Expand Up @@ -45,16 +45,19 @@ def test_own_dog_food(self):
msg='Failures: %s' % report.messages)


def _main():
def suite():
from testsuite.test_api import APITestCase
from testsuite.test_shell import ShellTestCase

suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(Pep8TestCase))
suite.addTest(unittest.makeSuite(APITestCase))
suite.addTest(unittest.makeSuite(ShellTestCase))
runner = unittest.TextTestRunner(verbosity=2)
return runner.run(suite)
return suite


def test_main():
return unittest.TextTestRunner(verbosity=2).run(suite())

if __name__ == '__main__':
sys.exit(not _main())
sys.exit(not test_main())

0 comments on commit e3e240c

Please sign in to comment.