summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2013-03-02 10:45:23 +0100
committerFlorent Xicluna <florent.xicluna@gmail.com>2013-03-02 10:45:23 +0100
commite294d249f27c696d89991dc7a7518cc9ae7c797b (patch)
tree7bbafba1b07040a709672e2592f5dd25eea7c549 /testsuite
parente3e240cd2ae61f8b92730e93206546063ea6ff9e (diff)
downloadpep8-e294d249f27c696d89991dc7a7518cc9ae7c797b.tar.gz
nose compat
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/support.py5
-rw-r--r--testsuite/test_all.py11
2 files changed, 8 insertions, 8 deletions
diff --git a/testsuite/support.py b/testsuite/support.py
index 0c107c3..481117a 100644
--- a/testsuite/support.py
+++ b/testsuite/support.py
@@ -140,7 +140,6 @@ def init_tests(pep8style):
return report.counters['failed tests']
pep8style.runner = run_tests
-init_tests.__test__ = False
def run_tests(style):
@@ -159,4 +158,6 @@ def run_tests(style):
if options.testsuite:
init_tests(style)
return style.check_files()
-run_tests.__test__ = False
+
+# nose should not collect these functions
+init_tests.__test__ = run_tests.__test__ = False
diff --git a/testsuite/test_all.py b/testsuite/test_all.py
index 89c51f0..9ccf2fe 100644
--- a/testsuite/test_all.py
+++ b/testsuite/test_all.py
@@ -46,18 +46,17 @@ class Pep8TestCase(unittest.TestCase):
def suite():
- from testsuite.test_api import APITestCase
- from testsuite.test_shell import ShellTestCase
+ from testsuite import test_api, test_shell
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(Pep8TestCase))
- suite.addTest(unittest.makeSuite(APITestCase))
- suite.addTest(unittest.makeSuite(ShellTestCase))
+ suite.addTest(unittest.makeSuite(test_api.APITestCase))
+ suite.addTest(unittest.makeSuite(test_shell.ShellTestCase))
return suite
-def test_main():
+def _main():
return unittest.TextTestRunner(verbosity=2).run(suite())
if __name__ == '__main__':
- sys.exit(not test_main())
+ sys.exit(not _main())