Rev 5564: Skip tests that don't support newer sphinx versions. in file:///home/vila/src/bzr/bugs/688072-skip-sphinx-failures/

Vincent Ladeuil v.ladeuil+lp at free.fr
Thu Dec 9 14:57:28 GMT 2010


At file:///home/vila/src/bzr/bugs/688072-skip-sphinx-failures/

------------------------------------------------------------
revno: 5564
revision-id: v.ladeuil+lp at free.fr-20101209145727-h88rrl0m08oavy6j
parent: pqm at pqm.ubuntu.com-20101208085718-krp2xe9v3i446gpv
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 688072-skip-sphinx-failures
timestamp: Thu 2010-12-09 15:57:27 +0100
message:
  Skip tests that don't support newer sphinx versions.
-------------- next part --------------
=== 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 14:57:27 +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(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 14:57:27 +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 14:57:27 +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 14:57:27 +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