[Zope3-checkins] CVS: Zope3/src/zope/configuration/tests - test_config.py:1.4

Jim Fulton jim at zope.com
Tue Sep 23 15:12:33 EDT 2003


Update of /cvs-repository/Zope3/src/zope/configuration/tests
In directory cvs.zope.org:/tmp/cvs-serv19668/src/zope/configuration/tests

Modified Files:
	test_config.py 
Log Message:
Updated a test to make it runnable in a loop.

The test tested handling of errors during module import.
Needed to remove the modules used from sys.modules, so that subsequent
test runs would get the same result.


=== Zope3/src/zope/configuration/tests/test_config.py 1.3 => 1.4 ===
--- Zope3/src/zope/configuration/tests/test_config.py:1.3	Tue Jul 29 16:39:40 2003
+++ Zope3/src/zope/configuration/tests/test_config.py	Tue Sep 23 15:12:33 2003
@@ -16,6 +16,7 @@
 $Id$
 """
 
+import sys
 import unittest
 from zope.testing.doctestunit import DocTestSuite
 from zope.configuration.config import metans, ConfigurationMachine
@@ -247,7 +248,7 @@
     """
 
 def test_bad_import():
-    """Dotted names are no longer allowed to end in dots
+    """
 
     >>> c = config.ConfigurationContext()
 
@@ -256,6 +257,12 @@
     ...
     ConfigurationError: Couldn't import zope.configuration.tests.victim,""" \
                                        """ No module named bad_to_the_bone
+
+    Cleanup:
+
+    >>> del sys.modules['zope.configuration.tests.victim']
+    >>> del sys.modules['zope.configuration.tests.bad']
+
     """
     
 




More information about the Zope3-Checkins mailing list