[Zope3-checkins] SVN: Zope3/trunk/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:56:20 EDT 2004


Log message for revision 26108:
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.

(This is revision 26107 merged from the ZopeX3-3.0 branch.)



-=-
Modified: Zope3/trunk/src/zope/importtool/tests/error.py
===================================================================
--- Zope3/trunk/src/zope/importtool/tests/error.py	2004-07-06 16:39:22 UTC (rev 26107)
+++ Zope3/trunk/src/zope/importtool/tests/error.py	2004-07-06 16:56:20 UTC (rev 26108)
@@ -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