Merge lp:~jameinel/bzr/2.3-test-loader into lp:bzr

Proposed by John A Meinel
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merged at revision: 5409
Proposed branch: lp:~jameinel/bzr/2.3-test-loader
Merge into: lp:bzr
Diff against target: 52 lines (+21/-0)
3 files modified
NEWS (+4/-0)
bzrlib/tests/__init__.py (+4/-0)
bzrlib/tests/test_selftest.py (+13/-0)
To merge this branch: bzr merge lp:~jameinel/bzr/2.3-test-loader
Reviewer Review Type Date Requested Status
Jelmer Vernooij (community) Approve
Review via email: mp+34481@code.launchpad.net

Commit message

Restore TestSuite and TestLoader as attributes of bzrlib.tests

Description of the change

Recently Vincent was cleaning up some imports (as part of cleaning up leaking threads in tests.)

He ended up removing bzrlib.tests.TestSuite/TestLoader (because they were from the TestUtil module).

However, I think it is very useful for plugins, etc to be able to just grab the things they need for testing from one location.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve
Revision history for this message
John A Meinel (jameinel) wrote :

sent to pqm by email

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'NEWS'
--- NEWS 2010-09-01 18:06:19 +0000
+++ NEWS 2010-09-02 20:21:00 +0000
@@ -154,6 +154,10 @@
154 users to attach to their own processes by default.154 users to attach to their own processes by default.
155 (Martin Pool, #626679)155 (Martin Pool, #626679)
156156
157* Test classes like ``TestCase``, ``TestLoader``, and ``TestSuite`` should
158 be available from ``bzrlib.tests.*``. They used to be, but were
159 accidentally removed. (John Arbash Meinel, #627438)
160
157* ``Transport.stat`` on a symlink, including a transport pointing directly161* ``Transport.stat`` on a symlink, including a transport pointing directly
158 to a symlink, now returns information about the symlink.162 to a symlink, now returns information about the symlink.
159 (Martin Pool)163 (Martin Pool)
160164
=== modified file 'bzrlib/tests/__init__.py'
--- bzrlib/tests/__init__.py 2010-08-30 07:42:12 +0000
+++ bzrlib/tests/__init__.py 2010-09-02 20:21:00 +0000
@@ -135,6 +135,10 @@
135SUBUNIT_SEEK_SET = 0135SUBUNIT_SEEK_SET = 0
136SUBUNIT_SEEK_CUR = 1136SUBUNIT_SEEK_CUR = 1
137137
138# These are intentionally brought into this namespace. That way plugins, etc
139# can just "from bzrlib.tests import TestCase, TestLoader, etc"
140TestSuite = TestUtil.TestSuite
141TestLoader = TestUtil.TestLoader
138142
139class ExtendedTestResult(testtools.TextTestResult):143class ExtendedTestResult(testtools.TextTestResult):
140 """Accepts, reports and accumulates the results of running tests.144 """Accepts, reports and accumulates the results of running tests.
141145
=== modified file 'bzrlib/tests/test_selftest.py'
--- bzrlib/tests/test_selftest.py 2010-08-17 22:24:01 +0000
+++ bzrlib/tests/test_selftest.py 2010-09-02 20:21:00 +0000
@@ -122,6 +122,19 @@
122 self.failUnlessExists(filename)122 self.failUnlessExists(filename)
123123
124124
125class TestClassesAvailable(tests.TestCase):
126 """As a convenience we expose Test* classes from bzrlib.tests"""
127
128 def test_test_case(self):
129 from bzrlib.tests import TestCase
130
131 def test_test_loader(self):
132 from bzrlib.tests import TestLoader
133
134 def test_test_suite(self):
135 from bzrlib.tests import TestSuite
136
137
125class TestTransportScenarios(tests.TestCase):138class TestTransportScenarios(tests.TestCase):
126 """A group of tests that test the transport implementation adaption core.139 """A group of tests that test the transport implementation adaption core.
127140