[Checkins] SVN: z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/ add extra paths option for packages that relies on zope 2

Jean-Francois Roche jfroche at jfroche.be
Sun Oct 25 17:18:47 EDT 2009


Log message for revision 105273:
  add extra paths option for packages that relies on zope 2

Changed:
  U   z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/README.txt
  U   z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/recipe.py

-=-
Modified: z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/README.txt
===================================================================
--- z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/README.txt	2009-10-25 19:22:17 UTC (rev 105272)
+++ z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/README.txt	2009-10-25 21:18:47 UTC (rev 105273)
@@ -81,3 +81,25 @@
 
 Every options prefixed by ``runner-`` will be automatically passed to the
 generated test runners.
+
+
+Passing Extra paths to the test runners
+=======================================
+
+If you want to add some paths to the generated test runners, you can do it with
+the extra-paths option in the part. This might be interesting if you want to test packages
+that depends on zope2 < 2.12:
+
+>>> write('buildout.cfg', """
+... [buildout]
+... parts = compattest
+...
+... [compattest]
+... recipe = z3c.recipe.compattest
+... include = z3c.recipe.compattest
+... extra-paths = zope2location/lib/python
+... """)
+>>> ignore = system(buildout)
+>>> cat('bin', 'compattest-z3c.recipe.compattest')
+#!...python...
+...zope2location/lib/python...

Modified: z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/recipe.py
===================================================================
--- z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/recipe.py	2009-10-25 19:22:17 UTC (rev 105272)
+++ z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/recipe.py	2009-10-25 21:18:47 UTC (rev 105273)
@@ -26,6 +26,7 @@
 
         self.include = string2list(self.options.get('include', ''), [])
         self.exclude = string2list(self.options.get('exclude', ''), [])
+        self.extra_paths = self.options.get('extra-paths', '')
         self.wanted_packages = self._wanted_packages()
 
         self.script = self.options.get('script', self.name)
@@ -55,6 +56,8 @@
 
             options = self.testrunner_options.copy()
             options['eggs'] = package + extras
+            if self.extra_paths:
+                options['extra-paths'] = self.extra_paths
 
             recipe = zc.recipe.testrunner.TestRunner(
                 self.buildout, '%s-%s' % (self.name, package), options)



More information about the checkins mailing list