[Checkins] SVN: grok/branches/ulif-testsetup/src/grok/testing.py Inject new fallback into TestCollector.

Uli Fouquet uli at gnufix.de
Wed Feb 20 18:29:04 EST 2008


Log message for revision 84095:
  Inject new fallback into TestCollector.

Changed:
  U   grok/branches/ulif-testsetup/src/grok/testing.py

-=-
Modified: grok/branches/ulif-testsetup/src/grok/testing.py
===================================================================
--- grok/branches/ulif-testsetup/src/grok/testing.py	2008-02-20 23:27:18 UTC (rev 84094)
+++ grok/branches/ulif-testsetup/src/grok/testing.py	2008-02-20 23:29:04 UTC (rev 84095)
@@ -28,8 +28,21 @@
     sync, ZCMLLayer, FunctionalDocFileSuite)
 
 class GrokTestCollector(z3c.testsetup.TestCollector):
-    pass
 
+    def initialize(self):
+        # inject the grok ftesting ZCML as fallback...
+        if 'zcml_config' in self.settings.keys():
+            return
+        pkg_path = os.path.dirname(self.package.__file__)
+        if os.path.isfile(os.path.join(pkg_path, 'ftesting.zcml')):
+            return
+        self.settings['zcml_config'] = os.path.join(
+            os.path.dirname(__file__), 'ftesting.zcml')
+        if 'layer_name' in self.settings.keys():
+            return
+        self.settings['layer_name'] = 'GrokFunctionalLayer'
+
+
 def register_all_tests(pkg, *args, **kw):
     return GrokTestCollector(pkg, *args, **kw)
 



More information about the Checkins mailing list