Skip to content

Commit e294d24

Browse files
committed
nose compat
1 parent e3e240c commit e294d24

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

testsuite/support.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ def run_tests(filename):
140140
return report.counters['failed tests']
141141

142142
pep8style.runner = run_tests
143-
init_tests.__test__ = False
144143

145144

146145
def run_tests(style):
@@ -159,4 +158,6 @@ def run_tests(style):
159158
if options.testsuite:
160159
init_tests(style)
161160
return style.check_files()
162-
run_tests.__test__ = False
161+
162+
# nose should not collect these functions
163+
init_tests.__test__ = run_tests.__test__ = False

testsuite/test_all.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,17 @@ def test_own_dog_food(self):
4646

4747

4848
def suite():
49-
from testsuite.test_api import APITestCase
50-
from testsuite.test_shell import ShellTestCase
49+
from testsuite import test_api, test_shell
5150

5251
suite = unittest.TestSuite()
5352
suite.addTest(unittest.makeSuite(Pep8TestCase))
54-
suite.addTest(unittest.makeSuite(APITestCase))
55-
suite.addTest(unittest.makeSuite(ShellTestCase))
53+
suite.addTest(unittest.makeSuite(test_api.APITestCase))
54+
suite.addTest(unittest.makeSuite(test_shell.ShellTestCase))
5655
return suite
5756

5857

59-
def test_main():
58+
def _main():
6059
return unittest.TextTestRunner(verbosity=2).run(suite())
6160

6261
if __name__ == '__main__':
63-
sys.exit(not test_main())
62+
sys.exit(not _main())

0 commit comments

Comments
 (0)