Rev 5568: (vila) Check sphinx version for tests that need it. (Vincent Ladeuil) in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Tue Dec 14 17:23:59 GMT 2010


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 5568 [merge]
revision-id: pqm at pqm.ubuntu.com-20101214172357-zkr4giq14bvd27v2
parent: pqm at pqm.ubuntu.com-20101214162712-3tjnh2884hvsv616
parent: v.ladeuil+lp at free.fr-20101209213401-8ttm61rh8xm52b70
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2010-12-14 17:23:57 +0000
message:
  (vila) Check sphinx version for tests that need it. (Vincent Ladeuil)
modified:
  bzrlib/tests/doc_generate/__init__.py __init__.py-20100429153409-fpdr7jznxqojupd2-1
  bzrlib/tests/doc_generate/builders/test_texinfo.py test_texinfo.py-20100429153416-rrbyt0aljyz1mgl8-1
  bzrlib/tests/doc_generate/writers/test_texinfo.py test_texinfo.py-20100706132149-5xascqycp14tbyci-1
  doc/en/release-notes/bzr-2.3.txt NEWS-20050323055033-4e00b5db738777ff
=== modified file 'bzrlib/tests/doc_generate/__init__.py'
--- a/bzrlib/tests/doc_generate/__init__.py	2010-07-21 08:07:14 +0000
+++ b/bzrlib/tests/doc_generate/__init__.py	2010-12-09 21:34:01 +0000
@@ -52,6 +52,11 @@
 
     _test_needs_features = [features.sphinx]
 
+    def sphinx_version(self):
+        # Convert to a tuple to avoid traps in string comparison
+        # ( '1.12' < '1.6' but (1, 12) > (1, 6) )
+        return tuple(map(int, features.sphinx.module.__version__.split('.')))
+
     def make_sphinx(self):
         out = tests.StringIOWrapper()
         err = tests.StringIOWrapper()

=== modified file 'bzrlib/tests/doc_generate/builders/test_texinfo.py'
--- a/bzrlib/tests/doc_generate/builders/test_texinfo.py	2010-07-06 13:22:32 +0000
+++ b/bzrlib/tests/doc_generate/builders/test_texinfo.py	2010-12-09 15:04:24 +0000
@@ -43,6 +43,8 @@
 class TestFileProduction(test_dg.TestSphinx):
 
     def test_files_generated(self):
+        if self.sphinx_version() >= (1, 0):
+            raise tests.TestSkipped('Not compatible with sphinx >= 1.0')
         self.build_tree_contents(
             [('index.txt', """
 Table of Contents

=== modified file 'bzrlib/tests/doc_generate/writers/test_texinfo.py'
--- a/bzrlib/tests/doc_generate/writers/test_texinfo.py	2010-07-21 08:07:14 +0000
+++ b/bzrlib/tests/doc_generate/writers/test_texinfo.py	2010-12-09 15:04:24 +0000
@@ -16,6 +16,7 @@
 
 """sphinx texinfo writer tests."""
 
+from bzrlib import tests
 from bzrlib.tests import (
     doc_generate as test_dg, # Avoid clash with from bzrlib import doc_generate
     )
@@ -176,6 +177,8 @@
 class TestTocTreeGeneration(test_dg.TestSphinx):
 
     def test_toctree(self):
+        if self.sphinx_version() >= (1, 0):
+            raise tests.TestSkipped('Not compatible with sphinx >= 1.0')
         self.build_tree_contents(
             [('index.txt', """
 Table of Contents

=== 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-09 15:04:24 +0000
@@ -64,6 +64,9 @@
 * Catch exceptions related to bug #637821 during test cleanup to avoid
   spurious failures. (Vincent Ladeuil, #686008).
 
+* Check sphinx compatibility for tests requiring older sphinx versions.
+  (Vincent Ladeuil, #688072)
+
 * ``TestDebuntuExpansions`` was escaping the test isolation by calling the
   wrong base class ``setUp``. (Vincent Ladeuil, #684622)
 




More information about the bazaar-commits mailing list