diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-05-25 00:51:58 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-05-25 00:51:58 (GMT) |
commit | 14a3dd716d2da4158739e502e8af8ef12e944cac (patch) | |
tree | b38d876499ded8041f9df25a9e6e369845c7556d /Lib/test/test_unittest.py | |
parent | db31d75eb14174e4206f0dee12705ffb0d824e77 (diff) | |
download | cpython-14a3dd716d2da4158739e502e8af8ef12e944cac.zip cpython-14a3dd716d2da4158739e502e8af8ef12e944cac.tar.gz cpython-14a3dd716d2da4158739e502e8af8ef12e944cac.tar.bz2 |
Merged revisions 72905 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r72905 | benjamin.peterson | 2009-05-24 19:48:58 -0500 (Sun, 24 May 2009) | 4 lines
make class skipping decorators the same as skipping every test of the class
This removes ClassTestSuite and a good bit of hacks.
........
Diffstat (limited to 'Lib/test/test_unittest.py')
-rw-r--r-- | Lib/test/test_unittest.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Lib/test/test_unittest.py b/Lib/test/test_unittest.py index e7097cc..ea33180 100644 --- a/Lib/test/test_unittest.py +++ b/Lib/test/test_unittest.py @@ -106,7 +106,7 @@ class TestHashing(object): # List subclass we can add attributes to. class MyClassSuite(list): - def __init__(self, tests, klass): + def __init__(self, tests): super(MyClassSuite, self).__init__(tests) @@ -1271,7 +1271,7 @@ class Test_TestLoader(TestCase): tests = [Foo('test_1'), Foo('test_2')] loader = unittest.TestLoader() - loader.classSuiteClass = MyClassSuite + loader.suiteClass = list self.assertEqual(loader.loadTestsFromTestCase(Foo), tests) # It is implicit in the documentation for TestLoader.suiteClass that @@ -1284,7 +1284,7 @@ class Test_TestLoader(TestCase): def foo_bar(self): pass m.Foo = Foo - tests = [unittest.ClassTestSuite([Foo('test_1'), Foo('test_2')], Foo)] + tests = [[Foo('test_1'), Foo('test_2')]] loader = unittest.TestLoader() loader.suiteClass = list @@ -1303,7 +1303,7 @@ class Test_TestLoader(TestCase): tests = [Foo('test_1'), Foo('test_2')] loader = unittest.TestLoader() - loader.classSuiteClass = MyClassSuite + loader.suiteClass = list self.assertEqual(loader.loadTestsFromName('Foo', m), tests) # It is implicit in the documentation for TestLoader.suiteClass that @@ -1316,7 +1316,7 @@ class Test_TestLoader(TestCase): def foo_bar(self): pass m.Foo = Foo - tests = [unittest.ClassTestSuite([Foo('test_1'), Foo('test_2')], Foo)] + tests = [[Foo('test_1'), Foo('test_2')]] loader = unittest.TestLoader() loader.suiteClass = list @@ -2842,7 +2842,7 @@ class Test_TestSkipping(TestCase): def test_dont_skip(self): pass test_do_skip = Foo("test_skip") test_dont_skip = Foo("test_dont_skip") - suite = unittest.ClassTestSuite([test_do_skip, test_dont_skip], Foo) + suite = unittest.TestSuite([test_do_skip, test_dont_skip]) events = [] result = LoggingResult(events) suite.run(result) @@ -2861,9 +2861,10 @@ class Test_TestSkipping(TestCase): record.append(1) record = [] result = unittest.TestResult() - suite = unittest.ClassTestSuite([Foo("test_1")], Foo) + test = Foo("test_1") + suite = unittest.TestSuite([test]) suite.run(result) - self.assertEqual(result.skipped, [(suite, "testing")]) + self.assertEqual(result.skipped, [(test, "testing")]) self.assertEqual(record, []) def test_expected_failure(self): |