[Checkins] SVN: zope.testing/branches/stub-testSetUp_in_layer/src/zope/testing/testrunner.py Reset layer_name -> layer cache on run() to enforce test isolation.

Stuart Bishop cvs-admin at zope.org
Fri Jun 16 03:22:12 EDT 2006


Log message for revision 68687:
  Reset layer_name -> layer cache on run() to enforce test isolation.

Changed:
  U   zope.testing/branches/stub-testSetUp_in_layer/src/zope/testing/testrunner.py

-=-
Modified: zope.testing/branches/stub-testSetUp_in_layer/src/zope/testing/testrunner.py
===================================================================
--- zope.testing/branches/stub-testSetUp_in_layer/src/zope/testing/testrunner.py	2006-06-16 06:30:00 UTC (rev 68686)
+++ zope.testing/branches/stub-testSetUp_in_layer/src/zope/testing/testrunner.py	2006-06-16 07:22:08 UTC (rev 68687)
@@ -299,6 +299,9 @@
     of any kind.
     """
 
+    global _layer_name_cache
+    _layer_name_cache = {} # Reset to enforce test isolation
+
     if options.resume_layer:
         original_stderr = sys.stderr
         sys.stderr = sys.stdout
@@ -939,6 +942,7 @@
        to allow locating layers in cases where it would otherwise be
        impossible.
     """
+    global _layer_name_cache
     if _layer_name_cache.has_key(layer_name):
         return _layer_name_cache[layer_name]
     layer_names = layer_name.split('.')



More information about the Checkins mailing list