summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/test/test_suite.py
diff options
context:
space:
mode:
authorMichael Foord <fuzzyman@voidspace.org.uk>2010-05-08 17:10:05 (GMT)
committerMichael Foord <fuzzyman@voidspace.org.uk>2010-05-08 17:10:05 (GMT)
commit73162197aae715815faf90060f1df5636db99ed0 (patch)
tree8904c78d988c3993ae942f1ebe9eb19f9d13a4be /Lib/unittest/test/test_suite.py
parent06507eb7914a604343603505d2ccacdbd91c4f38 (diff)
downloadcpython-73162197aae715815faf90060f1df5636db99ed0.zip
cpython-73162197aae715815faf90060f1df5636db99ed0.tar.gz
cpython-73162197aae715815faf90060f1df5636db99ed0.tar.bz2
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. ........
Diffstat (limited to 'Lib/unittest/test/test_suite.py')
-rw-r--r--Lib/unittest/test/test_suite.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/unittest/test/test_suite.py b/Lib/unittest/test/test_suite.py
index 465ba75..ab2e16e 100644
--- a/Lib/unittest/test/test_suite.py
+++ b/Lib/unittest/test/test_suite.py
@@ -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()