Skip to content

Commit

Permalink
- Fixed bug in using exclude (.remove on a set() doesn't work).
Browse files Browse the repository at this point in the history
- Added test to make sure it doesn't happen again.
- Added normalization for setuptools/distribute difference.
  • Loading branch information
reinout committed Dec 14, 2009
1 parent 9fe9363 commit 08ff2f6
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CHANGES.txt
Expand Up @@ -5,7 +5,8 @@ CHANGES
0.13 (unreleased)
=================

- Nothing changed yet.
- Fixed bug in using exclude introduced in 0.12 (including test to make sure
it doesn't happen again).


0.12 (2009-12-14)
Expand Down
26 changes: 26 additions & 0 deletions src/z3c/recipe/compattest/README.txt
Expand Up @@ -85,6 +85,32 @@ All our direct dependencies have a test script now:
- compattest-zc.buildout
- compattest-zc.recipe.testrunner

And if you want to exclude one of the automatically included dependencies, use
the ``exclude`` option:

>>> write('buildout.cfg', """
... [buildout]
... parts = compattest
...
... [compattest]
... recipe = z3c.recipe.compattest
... include-dependencies = z3c.recipe.compattest
... exclude = zc.buildout
... """)
>>> print 'start', system(buildout)
start ...
Generated script '/sample-buildout/bin/compattest'.

``bin/compattest-zc.buildout`` is now missing:

>>> ls('bin')
- buildout
- compattest
- compattest-setuptools
- compattest-z3c.recipe.compattest
- compattest-zc.recipe.testrunner



Passing options to the test runners
===================================
Expand Down
2 changes: 1 addition & 1 deletion src/z3c/recipe/compattest/recipe.py
Expand Up @@ -97,7 +97,7 @@ def _find_dependencies(self):

def _wanted_packages(self):
projects = self.include + self._find_dependencies()
projects = set(projects) # Filter out duplicates.
projects = list(set(projects)) # Filter out duplicates.
for project in projects:
for regex in self.exclude:
if re.compile(regex).search(project):
Expand Down
14 changes: 11 additions & 3 deletions src/z3c/recipe/compattest/testing.py
Expand Up @@ -8,6 +8,13 @@
re.compile('(\n?)- ([a-zA-Z0-9_.-]+)-script.py\n- \\2.exe\n'),
'\\1- \\2\n')

# Distribute does not result in a setuptools compattest binary, so filter that
# out.
normalize_setuptools = (
re.compile('- compattest-setuptools\n'),
'')


def DocFileSuite(*args, **kw):
def setUp(test):
zc.buildout.testing.buildoutSetUp(test)
Expand All @@ -30,8 +37,9 @@ def tearDown(test):
kw['optionflags'] = (doctest.ELLIPSIS
| doctest.NORMALIZE_WHITESPACE)
kw['checker'] = renormalizing.RENormalizing([
zc.buildout.testing.normalize_path,
normalize_script,
])
zc.buildout.testing.normalize_path,
normalize_script,
normalize_setuptools,
])

return doctest.DocFileSuite(*args, **kw)

0 comments on commit 08ff2f6

Please sign in to comment.