[Zope-Checkins] SVN: Zope/branches/2.9/lib/python/Testing/ZopeTestCase/zopedoctest/functional.py fix resolving Issue 2178

david whitfield Morriss whit at openplans.org
Mon Aug 28 17:21:40 EDT 2006


Log message for revision 69818:
  fix resolving Issue 2178

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

-=-
Modified: Zope/branches/2.9/lib/python/Testing/ZopeTestCase/zopedoctest/functional.py
===================================================================
--- Zope/branches/2.9/lib/python/Testing/ZopeTestCase/zopedoctest/functional.py	2006-08-28 21:21:18 UTC (rev 69817)
+++ Zope/branches/2.9/lib/python/Testing/ZopeTestCase/zopedoctest/functional.py	2006-08-28 21:21:39 UTC (rev 69818)
@@ -194,6 +194,14 @@
 
     return DocResponseWrapper(response, outstream, path, header_output)
 
+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
 
 class ZopeSuiteFactory:
 
@@ -298,23 +306,23 @@
                                        | doctest.REPORT_NDIFF
                                        | doctest.NORMALIZE_WHITESPACE)
 
-
+ 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