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
1=== modified file 'lib/canonical/testing/customresult.py'
2--- lib/canonical/testing/customresult.py 2009-06-25 05:30:52 +0000
3+++ lib/canonical/testing/customresult.py 2009-09-26 14:30:31 +0000
4@@ -13,7 +13,7 @@
5
6 from unittest import TestSuite
7 from testtools import MultiTestResult, iterate_tests
8-from zope.testing import testrunner
9+from zope.testing.testrunner import find, runner
10
11
12 class NullOutputFormatter:
13@@ -39,10 +39,10 @@
14 `testrunner.find_tests` and returns a thing with the same type and
15 structure.
16 """
17- real_find_tests = testrunner.find_tests
18+ real_find_tests = find.find_tests
19 def find_tests(*args):
20 return hook(real_find_tests(*args))
21- testrunner.find_tests = find_tests
22+ find.find_tests = find_tests
23
24
25 def list_tests(tests_by_layer_name):
26@@ -84,7 +84,7 @@
27
28 :param result: A TestResult instance.
29 """
30- old_zope_factory = testrunner.TestResult
31+ old_zope_factory = runner.TestResult
32 def zope_result_factory(options, tests, layer_name=None):
33 zope_result = old_zope_factory(options, tests, layer_name=layer_name)
34 if isinstance(zope_result, MultiTestResult):
35@@ -92,4 +92,4 @@
36 else:
37 zope_result.options.output = NullOutputFormatter()
38 return MultiTestResult(result, zope_result)
39- testrunner.TestResult = zope_result_factory
40+ runner.TestResult = zope_result_factory