Kaydet (Commit) b8401c7c authored tarafından Benjamin Peterson's avatar Benjamin Peterson

add a test for bad atexit arguments

üst 711552bb
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment