[Zope3-checkins] SVN: Zope3/branches/ZopeX3-3.0/src/zope/importtool/tests/error.py Fix test to allow tests to be run in a loop.

Fred L. Drake, Jr. fred at zope.com
Tue Jul 6 12:39:22 EDT 2004


Log message for revision 26107:
Fix test to allow tests to be run in a loop.

Make sure the module used to raise an error during import removes itself
from sys.modules, so subsequent imports will try again.



-=-
Modified: Zope3/branches/ZopeX3-3.0/src/zope/importtool/tests/error.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/importtool/tests/error.py	2004-07-06 13:54:42 UTC (rev 26106)
+++ Zope3/branches/ZopeX3-3.0/src/zope/importtool/tests/error.py	2004-07-06 16:39:22 UTC (rev 26107)
@@ -18,6 +18,11 @@
 $Id$
 """
 
+import sys
+
 from zope.importtool.tests.test_hook import TestException
 
-raise TestException(__name__)
+try:
+    raise TestException(__name__)
+finally:
+    del sys.modules[__name__]



More information about the Zope3-Checkins mailing list