benjamin.peterson
2008-09-23 03:14:49 UTC
Author: benjamin.peterson
Date: Tue Sep 23 05:14:49 2008
New Revision: 66563
Log:
add a test for bad atexit arguments
Modified:
python/branches/py3k/Lib/test/test_atexit.py
Modified: python/branches/py3k/Lib/test/test_atexit.py
==============================================================================
--- python/branches/py3k/Lib/test/test_atexit.py (original)
+++ python/branches/py3k/Lib/test/test_atexit.py Tue Sep 23 05:14:49 2008
@@ -44,6 +44,10 @@
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)
Date: Tue Sep 23 05:14:49 2008
New Revision: 66563
Log:
add a test for bad atexit arguments
Modified:
python/branches/py3k/Lib/test/test_atexit.py
Modified: python/branches/py3k/Lib/test/test_atexit.py
==============================================================================
--- python/branches/py3k/Lib/test/test_atexit.py (original)
+++ python/branches/py3k/Lib/test/test_atexit.py Tue Sep 23 05:14:49 2008
@@ -44,6 +44,10 @@
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)