[Zope3-checkins] CVS: Zope3/lib/python/Persistence/tests - testModule.py:1.24

Jeremy Hylton jeremy@zope.com
Mon, 23 Sep 2002 12:27:15 -0400


Update of /cvs-repository/Zope3/lib/python/Persistence/tests
In directory cvs.zope.org:/tmp/cvs-serv3626

Modified Files:
	testModule.py 
Log Message:
Use exec to run import *, silencing warning about import * in function.


=== Zope3/lib/python/Persistence/tests/testModule.py 1.23 => 1.24 ===
--- Zope3/lib/python/Persistence/tests/testModule.py:1.23	Fri Sep 20 16:34:48 2002
+++ Zope3/lib/python/Persistence/tests/testModule.py	Mon Sep 23 12:27:14 2002
@@ -288,10 +288,11 @@
         mgr.new("A.B.C", """__all__ = ["a", "b"]; a, b, c = 1, 2, 3""")
         get_transaction().commit()
 
-        from A.B.C import *
-        self.assertEqual(a, 1)
-        self.assertEqual(b, 2)
-        self.assertRaises(KeyError, locals().__getitem__, "c")
+        d = {}
+        exec "from A.B.C import *" in d
+        self.assertEqual(d['a'], 1)
+        self.assertEqual(d['b'], 2)
+        self.assertRaises(KeyError, d.__getitem__, "c")
 
         mgr = PersistentModuleManager(self.registry)
         mgr.new("A.B.D", "from C import *")