diff options
author | Michael Foord <fuzzyman@voidspace.org.uk> | 2010-11-01 22:11:53 (GMT) |
---|---|---|
committer | Michael Foord <fuzzyman@voidspace.org.uk> | 2010-11-01 22:11:53 (GMT) |
commit | e5dc24e874da603d29d1e15035e38dd28e72a39f (patch) | |
tree | e4c059c61d65606b085fe213ab389cfda11e2817 /Lib/unittest/test/test_suite.py | |
parent | 68c3678253eb0bf1a15537d2725df9af15e2c913 (diff) | |
download | cpython-e5dc24e874da603d29d1e15035e38dd28e72a39f.zip cpython-e5dc24e874da603d29d1e15035e38dd28e72a39f.tar.gz cpython-e5dc24e874da603d29d1e15035e38dd28e72a39f.tar.bz2 |
Merged revisions 86101 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r86101 | michael.foord | 2010-11-01 21:09:03 +0000 (Mon, 01 Nov 2010) | 1 line
Fix issue 9926. TestSuite subclasses that override __call__ are called correctly.
........
Diffstat (limited to 'Lib/unittest/test/test_suite.py')
-rw-r--r-- | Lib/unittest/test/test_suite.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/unittest/test/test_suite.py b/Lib/unittest/test/test_suite.py index f4a7468..d212bd0 100644 --- a/Lib/unittest/test/test_suite.py +++ b/Lib/unittest/test/test_suite.py @@ -345,5 +345,19 @@ class Test_TestSuite(unittest.TestCase, TestEquality): self.assertEqual(result.testsRun, 2) + def test_overriding_call(self): + class MySuite(unittest.TestSuite): + called = False + def __call__(self, *args, **kw): + self.called = True + unittest.TestSuite.__call__(self, *args, **kw) + + suite = MySuite() + wrapper = unittest.TestSuite() + wrapper.addTest(suite) + wrapper(unittest.TestResult()) + self.assertTrue(suite.called) + + if __name__ == '__main__': unittest.main() |