Skip to content

Commit

Permalink
add extra paths option for packages that relies on zope 2
Browse files Browse the repository at this point in the history
  • Loading branch information
jfroche committed Oct 25, 2009
1 parent f5d7d0b commit 407da2a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/z3c/recipe/compattest/README.txt
Expand Up @@ -81,3 +81,25 @@ the ``--foo`` option by default to all generated test runners, you can set

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...
3 changes: 3 additions & 0 deletions src/z3c/recipe/compattest/recipe.py
Expand Up @@ -26,6 +26,7 @@ def __init__(self, buildout, name, options):

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)
Expand Down Expand Up @@ -55,6 +56,8 @@ def _install_testrunners(self):

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)
Expand Down

0 comments on commit 407da2a

Please sign in to comment.