From: Benjamin Peterson Date: Tue, 23 Sep 2008 03:14:49 +0000 (+0000) Subject: add a test for bad atexit arguments X-Git-Tag: v3.0rc2~155 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b8401c7cb175fdb4584fce8b847de5e8b7e15034;p=thirdparty%2FPython%2Fcpython.git add a test for bad atexit arguments --- diff --git a/Lib/test/test_atexit.py b/Lib/test/test_atexit.py index 6856042edc60..04af9fb143d0 100644 --- a/Lib/test/test_atexit.py +++ b/Lib/test/test_atexit.py @@ -44,6 +44,10 @@ class TestCase(unittest.TestCase): self.assertEqual(self.stream.getvalue(), "h4 (4,) {'kw': 'abc'}\nh4 () {}\nh1\n") + def test_badargs(self): + atexit.register(lambda: 1, 0, 0, (x for x in (1,2)), 0, 0) + self.assertRaises(TypeError, atexit._run_exitfuncs) + def test_order(self): # be sure handlers are executed in reverse order atexit.register(h1)