Merge lp:~jml/launchpad/subunit-fixes into lp:launchpad

Proposed by Jonathan Lange
Status: Merged
Merged at revision: not available
Proposed branch: lp:~jml/launchpad/subunit-fixes
Merge into: lp:launchpad
Diff against target: 40 lines
1 file modified
lib/canonical/testing/customresult.py (+5/-5)
To merge this branch: bzr merge lp:~jml/launchpad/subunit-fixes
Reviewer Review Type Date Requested Status
Michael Hudson-Doyle Approve
Review via email: mp+12457@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jonathan Lange (jml) wrote :

This branch updates our subunit support to deal with the new version of zope.testing that we have.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Looks fine. zope.testing still doesn't let us do this in a non-painful way?

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/canonical/testing/customresult.py'
--- lib/canonical/testing/customresult.py 2009-06-25 05:30:52 +0000
+++ lib/canonical/testing/customresult.py 2009-09-26 14:30:31 +0000
@@ -13,7 +13,7 @@
1313
14from unittest import TestSuite14from unittest import TestSuite
15from testtools import MultiTestResult, iterate_tests15from testtools import MultiTestResult, iterate_tests
16from zope.testing import testrunner16from zope.testing.testrunner import find, runner
1717
1818
19class NullOutputFormatter:19class NullOutputFormatter:
@@ -39,10 +39,10 @@
39 `testrunner.find_tests` and returns a thing with the same type and39 `testrunner.find_tests` and returns a thing with the same type and
40 structure.40 structure.
41 """41 """
42 real_find_tests = testrunner.find_tests42 real_find_tests = find.find_tests
43 def find_tests(*args):43 def find_tests(*args):
44 return hook(real_find_tests(*args))44 return hook(real_find_tests(*args))
45 testrunner.find_tests = find_tests45 find.find_tests = find_tests
4646
4747
48def list_tests(tests_by_layer_name):48def list_tests(tests_by_layer_name):
@@ -84,7 +84,7 @@
8484
85 :param result: A TestResult instance.85 :param result: A TestResult instance.
86 """86 """
87 old_zope_factory = testrunner.TestResult87 old_zope_factory = runner.TestResult
88 def zope_result_factory(options, tests, layer_name=None):88 def zope_result_factory(options, tests, layer_name=None):
89 zope_result = old_zope_factory(options, tests, layer_name=layer_name)89 zope_result = old_zope_factory(options, tests, layer_name=layer_name)
90 if isinstance(zope_result, MultiTestResult):90 if isinstance(zope_result, MultiTestResult):
@@ -92,4 +92,4 @@
92 else:92 else:
93 zope_result.options.output = NullOutputFormatter()93 zope_result.options.output = NullOutputFormatter()
94 return MultiTestResult(result, zope_result)94 return MultiTestResult(result, zope_result)
95 testrunner.TestResult = zope_result_factory95 runner.TestResult = zope_result_factory