diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2013-03-02 10:26:42 +0100 |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2013-03-02 10:26:42 +0100 |
commit | e3e240cd2ae61f8b92730e93206546063ea6ff9e (patch) | |
tree | 8b97f2387b8877599e767e5c1d51c415b0ddf868 | |
parent | 7b590ade7ce794056cd9c612f12bbd357f8289b1 (diff) | |
download | pep8-e3e240cd2ae61f8b92730e93206546063ea6ff9e.tar.gz |
Fix 'python setup.py test'
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | setup.py | 2 | ||||
-rw-r--r-- | testsuite/test_all.py | 11 |
3 files changed, 9 insertions, 6 deletions
diff --git a/.travis.yml b/.travis.yml index d0a21c2..fc3ad34 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 @@ -52,5 +52,5 @@ setup( 'Programming Language :: Python :: 3', 'Topic :: Software Development :: Libraries :: Python Modules', ], - test_suite='testsuite.test_all', + test_suite='testsuite.test_all.suite', ) diff --git a/testsuite/test_all.py b/testsuite/test_all.py index 2299f92..89c51f0 100644 --- a/testsuite/test_all.py +++ b/testsuite/test_all.py @@ -45,7 +45,7 @@ class Pep8TestCase(unittest.TestCase): msg='Failures: %s' % report.messages) -def _main(): +def suite(): from testsuite.test_api import APITestCase from testsuite.test_shell import ShellTestCase @@ -53,8 +53,11 @@ def _main(): 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()) |