Rev 5564: Tests requiring lazr.uri should check for its presence in file:///home/vila/src/bzr/bugs/687315-lazr-uri/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Wed Dec 8 13:36:03 GMT 2010
At file:///home/vila/src/bzr/bugs/687315-lazr-uri/
------------------------------------------------------------
revno: 5564
revision-id: v.ladeuil+lp at free.fr-20101208133603-232eq5yprfs4na51
parent: pqm at pqm.ubuntu.com-20101208085718-krp2xe9v3i446gpv
fixes bug(s): https://launchpad.net/bugs/687315
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 687315-lazr-uri
timestamp: Wed 2010-12-08 14:36:03 +0100
message:
Tests requiring lazr.uri should check for its presence
-------------- next part --------------
=== modified file 'bzrlib/plugins/launchpad/test_lp_api.py'
--- a/bzrlib/plugins/launchpad/test_lp_api.py 2010-03-05 08:55:12 +0000
+++ b/bzrlib/plugins/launchpad/test_lp_api.py 2010-12-08 13:36:03 +0000
@@ -25,12 +25,17 @@
launchpadlib_feature = ModuleAvailableFeature('launchpadlib')
+# launchpadlib internally requires lazr.uri for some use cases (needed by the
+# tests but not encountered in most plugin uses). This allows tests to be
+# skipped on platforms that provides lanchpadlib itself but fail to provide its
+# dependencies.
+lazr_uri_feature = ModuleAvailableFeature('lazr.uri')
class TestDependencyManagement(TestCase):
"""Tests for managing the dependency on launchpadlib."""
- _test_needs_features = [launchpadlib_feature]
+ _test_needs_features = [launchpadlib_feature, lazr_uri_feature]
def setUp(self):
TestCase.setUp(self)
@@ -72,7 +77,7 @@
class TestCacheDirectory(TestCase):
"""Tests for get_cache_directory."""
- _test_needs_features = [launchpadlib_feature]
+ _test_needs_features = [launchpadlib_feature, lazr_uri_feature]
def test_get_cache_directory(self):
# get_cache_directory returns the path to a directory inside the
=== modified file 'doc/en/release-notes/bzr-2.3.txt'
--- a/doc/en/release-notes/bzr-2.3.txt 2010-12-07 16:27:49 +0000
+++ b/doc/en/release-notes/bzr-2.3.txt 2010-12-08 13:36:03 +0000
@@ -64,6 +64,9 @@
* Catch exceptions related to bug #637821 during test cleanup to avoid
spurious failures. (Vincent Ladeuil, #686008).
+* Define a test feature for the ``lazr.uri`` ``launchpadlib`` dependency to
+ avoid spurious test failures. (Vincent Ladeuil, #687315)
+
* ``TestDebuntuExpansions`` was escaping the test isolation by calling the
wrong base class ``setUp``. (Vincent Ladeuil, #684622)
More information about the bazaar-commits
mailing list