[Zope-Checkins] CVS: Zope3/lib/python/Persistence/tests - testModule.py:1.13
Jeremy Hylton
jeremy@zope.com
Wed, 10 Jul 2002 19:17:31 -0400
Update of /cvs-repository/Zope3/lib/python/Persistence/tests
In directory cvs.zope.org:/tmp/cvs-serv30814
Modified Files:
testModule.py
Log Message:
closures cause core dumps. don't know why yet.
=== Zope3/lib/python/Persistence/tests/testModule.py 1.12 => 1.13 ===
g = f(3)
"""
+closure_src = """\
+def f(x):
+ def g(y):
+ return x + y
+ return g
+
+inc = f(1)
+"""
class TestModule(unittest.TestCase):
@@ -151,6 +159,17 @@
get_transaction().commit()
import test
self.assertEqual(test.f(1), 2)
+
+## def testClosure(self):
+
+## # This test causes a seg fault because ???
+
+## self.importer.module_from_source("closure", closure_src)
+## get_transaction().commit()
+## import closure
+## self.assertEqual(closure.inc(5), 6)
+## closure._p_deactivate()
+## self.assertEqual(closure.inc(5), 6)
def test_suite():
return unittest.makeSuite(TestModule)