Rev 5405: Fix bug #627438 by restoring TestSuite and TestLoader. in http://bazaar.launchpad.net/~jameinel/bzr/2.3-test-loader
John Arbash Meinel
john at arbash-meinel.com
Thu Sep 2 21:17:13 BST 2010
At http://bazaar.launchpad.net/~jameinel/bzr/2.3-test-loader
------------------------------------------------------------
revno: 5405
revision-id: john at arbash-meinel.com-20100902201703-idn4su89d1388srn
parent: pqm at pqm.ubuntu.com-20100901180619-u0q01om0gjzxxy2i
fixes bug(s): https://launchpad.net/bugs/627438
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.3-test-loader
timestamp: Thu 2010-09-02 15:17:03 -0500
message:
Fix bug #627438 by restoring TestSuite and TestLoader.
Add some tests to ensure that they stay available.
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS 2010-09-01 18:06:19 +0000
+++ b/NEWS 2010-09-02 20:17:03 +0000
@@ -154,6 +154,10 @@
users to attach to their own processes by default.
(Martin Pool, #626679)
+* Test classes like ``TestCase``, ``TestLoader``, and ``TestSuite`` should
+ be available from ``bzrlib.tests.*``. They used to be, but were
+ accidentally removed. (John Arbash Meinel, #627438)
+
* ``Transport.stat`` on a symlink, including a transport pointing directly
to a symlink, now returns information about the symlink.
(Martin Pool)
=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py 2010-08-30 07:42:12 +0000
+++ b/bzrlib/tests/__init__.py 2010-09-02 20:17:03 +0000
@@ -135,6 +135,10 @@
SUBUNIT_SEEK_SET = 0
SUBUNIT_SEEK_CUR = 1
+# These are intentionally brought into this namespace. That way plugins, etc
+# can just "from bzrlib.tests import TestCase, TestLoader, etc"
+TestSuite = TestUtil.TestSuite
+TestLoader = TestUtil.TestLoader
class ExtendedTestResult(testtools.TextTestResult):
"""Accepts, reports and accumulates the results of running tests.
=== modified file 'bzrlib/tests/test_selftest.py'
--- a/bzrlib/tests/test_selftest.py 2010-08-17 22:24:01 +0000
+++ b/bzrlib/tests/test_selftest.py 2010-09-02 20:17:03 +0000
@@ -122,6 +122,19 @@
self.failUnlessExists(filename)
+class TestClassesAvailable(tests.TestCase):
+ """As a convenience we expose Test* classes from bzrlib.tests"""
+
+ def test_test_case(self):
+ from bzrlib.tests import TestCase
+
+ def test_test_loader(self):
+ from bzrlib.tests import TestLoader
+
+ def test_test_suite(self):
+ from bzrlib.tests import TestSuite
+
+
class TestTransportScenarios(tests.TestCase):
"""A group of tests that test the transport implementation adaption core.
More information about the bazaar-commits
mailing list