Skip to content

Commit

Permalink
The z3c.recipe.scripts.scripts recipe behind zc.recipe.testrunner.Tes…
Browse files Browse the repository at this point in the history
…tRunner does not accept plain dicts, so we wrap the options in a _BackwardsSupportOptions object.
  • Loading branch information
janjaapdriessen committed Oct 5, 2010
1 parent 2823d97 commit 3c6d87c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ CHANGES
- Updated test set up, to run with newer ``zope.testing`` version which no
longer includes testrunner.

- The z3c.recipe.scripts.scripts recipe behind zc.recipe.testrunner.TestRunner
does not accept plain dicts, so we wrap the options in a
_BackwardsSupportOptions object.

0.12.2 (2010-02-24)
===================
Expand Down
2 changes: 1 addition & 1 deletion buildout.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ svn_url = svn://svn.zope.org/repos/main/
packages = zope.dottedname z3c.recipe.compattest

[versions]
zc.buildout = 1.4.4
zc.buildout = 1.5.1
8 changes: 4 additions & 4 deletions src/z3c/recipe/compattest/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ We take care about installing the test dependencies for the packages
declared a (superfluous) test dependency on ``zope.dottedname``, which is
picked up:

>>> cat('bin', 'compattest-z3c.recipe.compattest')
#!...python...
>>> cat('parts', 'compattest-z3c.recipe.compattest', 'site-packages', 'site.py')
"""Append module ...
...zope.dottedname...

If we use ``include-dependencies`` instead of just ``include``, our direct
Expand Down Expand Up @@ -153,6 +153,6 @@ that depends on zope2 < 2.12:
... extra-paths = zope2location/lib/python
... """)
>>> ignore = system(buildout)
>>> cat('bin', 'compattest-z3c.recipe.compattest')
#!...python...
>>> cat('parts', 'compattest-z3c.recipe.compattest', 'site-packages', 'site.py')
"""Append module ...
...zope2location/lib/python...
7 changes: 7 additions & 0 deletions src/z3c/recipe/compattest/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import re
import zc.buildout.easy_install
import zc.recipe.egg
from zc.recipe.egg.egg import _BackwardsSupportOption
import zc.recipe.testrunner


Expand Down Expand Up @@ -34,6 +35,7 @@ def __init__(self, buildout, name, options):

# gather options to be passed to the underlying testrunner
self.testrunner_options = {}

for opt in self.options:
if opt.startswith(RUNNER_PREFIX):
runner_opt = opt[len(RUNNER_PREFIX):]
Expand Down Expand Up @@ -61,6 +63,11 @@ def _install_testrunners(self, wanted_packages):
if self.extra_paths:
options['extra-paths'] = self.extra_paths

# The testrunner recipe that we are going to pass these options to
# expects the 'query_bool' attribute to be accessible.
# See also zc.recipe.egg:Eggs (v1.3.2)
options = _BackwardsSupportOption(options)

recipe = zc.recipe.testrunner.TestRunner(
self.buildout, '%s-%s' % (self.name, package), options)
installed.extend(recipe.install())
Expand Down
1 change: 1 addition & 0 deletions src/z3c/recipe/compattest/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def setUp(test):
# environment
zc.buildout.testing.install('zc.recipe.testrunner', test)
zc.buildout.testing.install('zc.recipe.egg', test)
zc.buildout.testing.install('z3c.recipe.scripts', test)
zc.buildout.testing.install('zope.testing', test)
zc.buildout.testing.install('zope.testrunner', test)
zc.buildout.testing.install('zope.interface', test)
Expand Down

0 comments on commit 3c6d87c

Please sign in to comment.