[Zope3-checkins]
SVN: zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/
moved filtering of functional layers using --resume-layer and
--layer to the
Christian Theune
ct at gocept.com
Sun May 4 15:03:01 EDT 2008
Log message for revision 86411:
moved filtering of functional layers using --resume-layer and --layer to the
filter feature
Changed:
U zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/filter.py
U zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/runner.py
-=-
Modified: zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/filter.py
===================================================================
--- zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/filter.py 2008-05-04 17:05:17 UTC (rev 86410)
+++ zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/filter.py 2008-05-04 19:02:58 UTC (rev 86411)
@@ -26,10 +26,10 @@
active = True
def global_setup(self):
- tests = self.runner.tests_by_layer_name
+ layers = self.runner.tests_by_layer_name
options = self.runner.options
- if 'unit' in tests:
+ if 'unit' in layers:
# We start out assuming unit tests should run and look for reasons
# why they shouldn't be run.
should_run = True
@@ -46,8 +46,22 @@
should_run = False
if not should_run:
- tests.pop('unit')
+ layers.pop('unit')
+ if self.runner.options.resume_layer is not None:
+ for name in list(layers):
+ if name != self.runner.options.resume_layer:
+ layers.pop(name)
+ elif self.runner.options.layer:
+ for name in list(layers):
+ for pat in self.runner.options.layer:
+ if pat(name):
+ # This layer matches a pattern selecting this layer
+ break
+ else:
+ # No pattern matched this name so we remove it
+ layers.pop(name)
+
if self.runner.options.verbose:
if self.runner.options.all:
msg = "Running tests at all levels"
Modified: zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/runner.py
===================================================================
--- zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/runner.py 2008-05-04 17:05:17 UTC (rev 86410)
+++ zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/runner.py 2008-05-04 19:02:58 UTC (rev 86411)
@@ -220,19 +220,6 @@
layers_to_run = list(self.ordered_layers())
- if self.options.resume_layer is not None:
- layers_to_run = [
- (layer_name, layer, tests)
- for (layer_name, layer, tests) in layers_to_run
- if layer_name == self.options.resume_layer
- ]
- elif self.options.layer:
- layers_to_run = [
- (layer_name, layer, tests)
- for (layer_name, layer, tests) in layers_to_run
- if filter(None, [pat(layer_name) for pat in self.options.layer])
- ]
-
for layer_name, layer, tests in layers_to_run:
self.nlayers += 1
try:
@@ -413,9 +400,11 @@
])
subin, subout, suberr = os.popen3(args)
+ subout_total = ''
while True:
try:
for l in subout:
+ subout_total += l
sys.stdout.write(l)
except IOError, e:
if e.errno == errno.EINTR:
@@ -435,7 +424,8 @@
raise
except:
raise SubprocessError(
- 'No subprocess summary found', line+suberr.read())
+ 'No subprocess summary found', subout_total)
+ #'No subprocess summary found', line+suberr.read())
while nfail > 0:
nfail -= 1
More information about the Zope3-Checkins
mailing list