[Checkins] SVN: grok/branches/sylvain-testlayers/ Remove z3c.testsetup test collector and z3c.testsetup dependency.

Uli Fouquet uli at gnufix.de
Thu Apr 29 09:15:56 EDT 2010


Log message for revision 111579:
  Remove z3c.testsetup test collector and z3c.testsetup dependency.

Changed:
  U   grok/branches/sylvain-testlayers/CHANGES.txt
  U   grok/branches/sylvain-testlayers/doc/upgrade.txt
  U   grok/branches/sylvain-testlayers/setup.py
  U   grok/branches/sylvain-testlayers/src/grok/testing.py

-=-
Modified: grok/branches/sylvain-testlayers/CHANGES.txt
===================================================================
--- grok/branches/sylvain-testlayers/CHANGES.txt	2010-04-29 13:06:52 UTC (rev 111578)
+++ grok/branches/sylvain-testlayers/CHANGES.txt	2010-04-29 13:15:56 UTC (rev 111579)
@@ -4,7 +4,9 @@
 1.1 (unreleased)
 ================
 
-- Nothing changed yet.
+* Removed z3c.testsetup-specific test collector from grok.testing. You
+  can still use z3c.testsetup with grok, but have to declare the
+  dependency in your project's ``setup.py`` explicitly.
 
 
 1.1rc1 (2010-02-25)

Modified: grok/branches/sylvain-testlayers/doc/upgrade.txt
===================================================================
--- grok/branches/sylvain-testlayers/doc/upgrade.txt	2010-04-29 13:06:52 UTC (rev 111578)
+++ grok/branches/sylvain-testlayers/doc/upgrade.txt	2010-04-29 13:15:56 UTC (rev 111579)
@@ -11,6 +11,21 @@
 **Warning**. Please be sure to always backup your data (especially the
 ``Data.fs`` file) before you perform upgrades.
 
+.. _upgrade_notes_1.1:
+
+Upgrading to 1.1 (unreleased)
+-----------------------------
+
+* `z3c.testsetup` dependency has been removed from grok. If you use
+  grok.testing.register_all_tests in your testsetup, make sure to
+  require ``z3c.testsetup`` (and also ``zope.app.testing``, if you use
+  functional tests) in `setup.py` of your project and use::
+
+    import z3c.testsetsetup
+    z3c.testsetup.register_all_tests(...)
+
+  where you used ``grok.testing.register_all_tests(...)`` before.
+
 .. _upgrade_notes_1.1rc1:
 
 Upgrading to 1.1rc1 (2010-02-25)

Modified: grok/branches/sylvain-testlayers/setup.py
===================================================================
--- grok/branches/sylvain-testlayers/setup.py	2010-04-29 13:06:52 UTC (rev 111578)
+++ grok/branches/sylvain-testlayers/setup.py	2010-04-29 13:15:56 UTC (rev 111579)
@@ -56,7 +56,6 @@
         'simplejson',
         'z3c.autoinclude',
         'z3c.flashmessage',
-        'z3c.testsetup',
         'zc.catalog',
         'zope.annotation',
         'zope.app.appsetup',

Modified: grok/branches/sylvain-testlayers/src/grok/testing.py
===================================================================
--- grok/branches/sylvain-testlayers/src/grok/testing.py	2010-04-29 13:06:52 UTC (rev 111578)
+++ grok/branches/sylvain-testlayers/src/grok/testing.py	2010-04-29 13:15:56 UTC (rev 111579)
@@ -14,31 +14,11 @@
 """Grok test helpers
 """
 import sys
-import os.path
-import z3c.testsetup
 from zope.configuration.config import ConfigurationMachine
 from grokcore.component import zcml
 # Provide this import here for BBB reasons:
 from grokcore.component.testing import grok_component
 
-class GrokTestCollector(z3c.testsetup.TestCollector):
-
-    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)
-
 def grok(module_name):
     config = ConfigurationMachine()
     zcml.do_grok('grokcore.component.meta', config)



More information about the checkins mailing list