[Zope-Checkins] SVN: Zope/branches/2.10/lib/python/Testing/ZopeTestCase/zopedoctest/functional.py fix for 2178

david whitfield Morriss whit at openplans.org
Mon Aug 28 17:39:05 EDT 2006


Log message for revision 69823:
  fix for 2178
  

Changed:
  U   Zope/branches/2.10/lib/python/Testing/ZopeTestCase/zopedoctest/functional.py

-=-
Modified: Zope/branches/2.10/lib/python/Testing/ZopeTestCase/zopedoctest/functional.py
===================================================================
--- Zope/branches/2.10/lib/python/Testing/ZopeTestCase/zopedoctest/functional.py	2006-08-28 21:35:41 UTC (rev 69822)
+++ Zope/branches/2.10/lib/python/Testing/ZopeTestCase/zopedoctest/functional.py	2006-08-28 21:39:03 UTC (rev 69823)
@@ -299,22 +299,36 @@
                                        | doctest.NORMALIZE_WHITESPACE)
 
 
+def extractLayer(func):
+    def wrap(*args, **kw):
+        suite = func(*args, **kw)
+        tc = kw.get('test_class', None)
+        if tc and hasattr(tc, 'layer'):
+            suite.layer = tc.layer
+        return suite
+    return wrap
+
+
+ at extractLayer
 def ZopeDocTestSuite(module=None, **kw):
     module = doctest._normalize_module(module)
     return ZopeSuiteFactory(module, **kw).doctestsuite()
 
 
+ at extractLayer
 def ZopeDocFileSuite(*paths, **kw):
     if kw.get('module_relative', True):
         kw['package'] = doctest._normalize_module(kw.get('package'))
     return ZopeSuiteFactory(*paths, **kw).docfilesuite()
 
 
+ at extractLayer
 def FunctionalDocTestSuite(module=None, **kw):
     module = doctest._normalize_module(module)
     return FunctionalSuiteFactory(module, **kw).doctestsuite()
 
 
+ at extractLayer
 def FunctionalDocFileSuite(*paths, **kw):
     if kw.get('module_relative', True):
         kw['package'] = doctest._normalize_module(kw.get('package'))



More information about the Zope-Checkins mailing list