Skip to content

Commit

Permalink
Do not be silent if a layer goes missing
Browse files Browse the repository at this point in the history
When we run some test layers in a subprocess (e.g. when you use
zope-testrunner -j2), each subprocess crawls the --test-path to find the
tests again.

If the --test-path is a relative pathname, and the parent process
changes the working directory during the test run, this will cause the
child process to fail to find the tests.  That is an error, and it
shouldn't be silently ignored.

This change needs automated tests!  I only tested it manually (and my
working directory has other uncommitted changes).
  • Loading branch information
mgedmin committed May 29, 2013
1 parent 94b860c commit 6f42681
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/zope/testrunner/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ def global_setup(self):
for name in list(layers):
if name != self.runner.options.resume_layer:
layers.pop(name)
if not layers:
self.runner.options.output.error_with_banner(
"Cannot find layer %s" % self.runner.options.resume_layer)
self.runner.errors.append(
("subprocess failed for %s" %
self.runner.options.resume_layer,
None))
elif self.runner.options.layer:
accept = build_filtering_func(self.runner.options.layer)
for name in list(layers):
Expand Down

0 comments on commit 6f42681

Please sign in to comment.