Fixing failing tests on Python 2.6
@@ -360,6 +360,19 @@ class RunfilesTest(unittest.TestCase):
try:
self.MyTestRunner.run_tests()
self.assertEqual(8, len(notifications))
+ if sys.version_info[:2] <= (2, 6):
+ # The setUpClass is not supported in Python 2.6 (thus we have no collection error).
+ expected = [
+ ('notifyTest', 'fail', '', 'AssertionError: Fail test 2', simple_test, 'SampleTest.test_xxxxxx1'),
+ ('notifyTest', 'ok', '', '', simple_test2, 'YetAnotherSampleTest.test_abc'),
+ ('notifyTest', 'ok', '', '', simpleClass_test, 'SetUpClassTest.test_blank'),
+ ('notifyTest', 'ok', '', '', simpleModule_test, 'SetUpModuleTest.test_blank'),
+ ('notifyTest', 'ok', '', '', simple_test, 'SampleTest.test_xxxxxx2'),
+ ('notifyTest', 'ok', 'non unique name ran', '', simple_test, 'SampleTest.test_non_unique_name'),
+ ('notifyTestRunFinished',),
+ ('notifyTestsCollected', 6)
+ ]
+ else:
expected = [
('notifyTestsCollected', 6),
('notifyTest', 'ok', 'non unique name ran', '', simple_test, 'SampleTest.test_non_unique_name'),
@@ -384,6 +397,7 @@ class RunfilesTest(unittest.TestCase):
expected.append(('notifyTest', 'ok', '', '', simpleModule_test, 'SetUpModuleTest.test_blank'))
expected.append(('notifyTestRunFinished',))
+
expected.sort()
new_notifications = []
for notification in expected:
@@ -412,7 +426,7 @@ class RunfilesTest(unittest.TestCase):
finally:
pydevd_io.end_redirect()
b = buf.getvalue()
- if not IS_JYTHON:
+ if sys.version_info[:2] > (2, 6):
self.assert_(b.find('Ran 4 tests in ') != -1, 'Found: ' + b)
else:
self.assert_(b.find('Ran 6 tests in ') != -1, 'Found: ' + b)
