mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Merged revisions 80997 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r80997 | michael.foord | 2010-05-08 19:06:25 +0200 (Sat, 08 May 2010) | 1 line unittest: issue 8301. Adding functions to test suites no longer crashes. ........
This commit is contained in:
parent
06507eb791
commit
73162197aa
2 changed files with 19 additions and 1 deletions
|
@ -289,3 +289,16 @@ class Test_TestSuite(unittest.TestCase, TestEquality):
|
|||
def test_addTests__string(self):
|
||||
suite = unittest.TestSuite()
|
||||
self.assertRaises(TypeError, suite.addTests, "foo")
|
||||
|
||||
def test_function_in_suite(self):
|
||||
def f(_):
|
||||
pass
|
||||
suite = unittest.TestSuite()
|
||||
suite.addTest(f)
|
||||
|
||||
# when the bug is fixed this line will not crash
|
||||
suite.run(unittest.TestResult())
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue