[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/component/back35.py Fixed a test that left sys.modules in a bad state under certain

Jim Fulton jim at zope.com
Fri Apr 28 13:11:48 EDT 2006


Log message for revision 67727:
  Fixed a test that left sys.modules in a bad state under certain
  circomstances.
  

Changed:
  U   Zope3/trunk/src/zope/app/component/back35.py

-=-
Modified: Zope3/trunk/src/zope/app/component/back35.py
===================================================================
--- Zope3/trunk/src/zope/app/component/back35.py	2006-04-28 17:11:37 UTC (rev 67726)
+++ Zope3/trunk/src/zope/app/component/back35.py	2006-04-28 17:11:47 UTC (rev 67727)
@@ -731,15 +731,15 @@
     >>> from types import ModuleType as module
     >>> import sys
     >>> layers = module('layers')
-    >>> old = sys.modules.get('zope.app.layers', None)
+    >>> import zope.app.layers
+    >>> old = sys.modules['zope.app.layers']
     >>> sys.modules['zope.app.layers'] = layers
     >>> setattr(layers, 'layer1', layer1)
 
     >>> field.fromUnicode('layer1') is layer1
     True
 
-    >>> if old is not None:
-    ...     sys.modules['zope.app.layers'] = old
+    >>> sys.modules['zope.app.layers'] = old
 
     Test 3: Get the layer from the site manager
     -------------------------------------------



More information about the Zope3-Checkins mailing list