From 2a3f53494df93d4fe0e67055f95fc3e33cf7e8f4 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Mon, 24 Jun 2019 16:07:20 +0100 Subject: [PATCH] Add support for Sphinx v2.1 Come a new Sphinx version, come new breakages. This one is because of commit 107c20a11f [1], which changed the default centering style of tables. [1] https://github.com/sphinx-doc/sphinx/commit/107c20a11f Change-Id: I1155300828ad0012bd80b7615a0baca121c5e72e Signed-off-by: Stephen Finucane --- os_api_ref/tests/test_basic_example.py | 15 +++++++++------ os_api_ref/tests/test_microversions.py | 4 ++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/os_api_ref/tests/test_basic_example.py b/os_api_ref/tests/test_basic_example.py index 20a4fad..dcfb7d7 100644 --- a/os_api_ref/tests/test_basic_example.py +++ b/os_api_ref/tests/test_basic_example.py @@ -94,7 +94,7 @@ class TestBasicExample(base.TestCase): # TODO(stephenfin): Drop support for this once we drop support for both # Python 2.7 and Sphinx < 2.0, likely in "U" if sphinx.version_info >= (2, 0, 0): - table = """ + table = """
@@ -115,7 +115,8 @@ class TestBasicExample(base.TestCase): -

The name of things

""" +""".format('center' if sphinx.version_info < (2, 1, 0) + else 'default') else: table = """@@ -147,7 +148,7 @@ class TestBasicExample(base.TestCase): # TODO(stephenfin): Drop support for this once we drop support for both # Python 2.7 and Sphinx < 2.0, likely in "U" if sphinx.version_info >= (2, 0, 0): - success_table = """
+ success_table = """
@@ -168,9 +169,10 @@ class TestBasicExample(base.TestCase): -

Resource was created and is ready to use.

""" +""".format('center' if sphinx.version_info < (2, 1, 0) + else 'default') - error_table = """ + error_table = """
@@ -200,7 +202,8 @@ class TestBasicExample(base.TestCase): -

There is already a zone with this name.

""" +""".format('center' if sphinx.version_info < (2, 1, 0) + else 'default') else: success_table = """table border="1" class="docutils"> diff --git a/os_api_ref/tests/test_microversions.py b/os_api_ref/tests/test_microversions.py index 11f3636..9aa4bf2 100644 --- a/os_api_ref/tests/test_microversions.py +++ b/os_api_ref/tests/test_microversions.py @@ -58,7 +58,7 @@ class TestMicroversions(base.TestCase): """Test that min / max mv css class attributes are set in params""" if sphinx.version_info >= (2, 0, 0): table = """
- +
@@ -95,7 +95,7 @@ class TestMicroversions(base.TestCase):
-""" # noqa +""".format('center' if sphinx.version_info < (2, 1, 0) else 'default') # noqa else: table = """