#61 Fix test failures with Python 3.11.7, 3.12.1 and later
Merged 6 months ago by ksurma. Opened 6 months ago by ksurma.
rpms/ ksurma/python-sphinx py3.13  into  rawhide

file added
+69
@@ -0,0 +1,69 @@ 

+ From bc8939b34037f81b8610f3b26caec128ee20a2f4 Mon Sep 17 00:00:00 2001

+ From: Karolina Surma <ksurma@redhat.com>

+ Date: Tue, 28 Nov 2023 14:43:58 +0100

+ Subject: [PATCH] Adjust the expected string to match Python 3.11+ changed

+  output

+ 

+ ---

+  tests/test_ext_autodoc_configs.py | 21 +++++++++++++++++----

+  1 file changed, 17 insertions(+), 4 deletions(-)

+ 

+ diff --git a/tests/test_ext_autodoc_configs.py b/tests/test_ext_autodoc_configs.py

+ index 45bc729b73e..0994c08e899 100644

+ --- a/tests/test_ext_autodoc_configs.py

+ +++ b/tests/test_ext_autodoc_configs.py

+ @@ -11,6 +11,7 @@

+  from .test_ext_autodoc import do_autodoc

+  

+  IS_PYPY = platform.python_implementation() == 'PyPy'

+ +IS_PY311_AND_LATER = sys.version_info >= (3, 11)

+  

+  

+  @contextmanager

+ @@ -1627,7 +1628,10 @@ def test_autodoc_default_options(app):

+      assert '      Iterate squares of each value.' in actual

+      if not IS_PYPY:

+          assert '   .. py:attribute:: CustomIter.__weakref__' in actual

+ -        assert '      list of weak references to the object (if defined)' in actual

+ +        if IS_PY311_AND_LATER:

+ +            assert '      list of weak references to the object' in actual

+ +        else:

+ +            assert '      list of weak references to the object (if defined)' in actual

+  

+      # :exclude-members: None - has no effect. Unlike :members:,

+      # :special-members:, etc. where None == "include all", here None means

+ @@ -1651,7 +1655,10 @@ def test_autodoc_default_options(app):

+      assert '      Iterate squares of each value.' in actual

+      if not IS_PYPY:

+          assert '   .. py:attribute:: CustomIter.__weakref__' in actual

+ -        assert '      list of weak references to the object (if defined)' in actual

+ +        if IS_PY311_AND_LATER:

+ +            assert '      list of weak references to the object' in actual

+ +        else:

+ +            assert '      list of weak references to the object (if defined)' in actual

+      assert '   .. py:method:: CustomIter.snafucate()' in actual

+      assert '      Makes this snafucated.' in actual

+  

+ @@ -1698,7 +1705,10 @@ def test_autodoc_default_options_with_values(app):

+      assert '      Iterate squares of each value.' in actual

+      if not IS_PYPY:

+          assert '   .. py:attribute:: CustomIter.__weakref__' not in actual

+ -        assert '      list of weak references to the object (if defined)' not in actual

+ +        if IS_PY311_AND_LATER:

+ +            assert '      list of weak references to the object' not in actual

+ +        else:

+ +            assert '      list of weak references to the object (if defined)' not in actual

+  

+      # with :exclude-members:

+      app.config.autodoc_default_options = {

+ @@ -1722,6 +1732,9 @@ def test_autodoc_default_options_with_values(app):

+      assert '      Iterate squares of each value.' in actual

+      if not IS_PYPY:

+          assert '   .. py:attribute:: CustomIter.__weakref__' not in actual

+ -        assert '      list of weak references to the object (if defined)' not in actual

+ +        if IS_PY311_AND_LATER:

+ +            assert '      list of weak references to the object' not in actual

+ +        else:

+ +            assert '      list of weak references to the object (if defined)' not in actual

+      assert '   .. py:method:: CustomIter.snafucate()' not in actual

+      assert '      Makes this snafucated.' not in actual

file modified
+8 -1
@@ -25,7 +25,7 @@ 

  #global     prerel ...

  %global     upstream_version %{general_version}%{?prerel}

  Version:    %{general_version}%{?prerel:~%{prerel}}

- Release:    3%{?dist}

+ Release:    4%{?dist}

  Epoch:      1

  Summary:    Python documentation generator

  
@@ -55,6 +55,10 @@ 

  # The change is proposed upstream.

  Patch:      https://github.com/sphinx-doc/sphinx/pull/11747.patch

  

+ # Fix the expected test docstring to match output in Python 3.11.7, 3.12.1 and later

+ # Proposed upstream.

+ Patch:      https://github.com/sphinx-doc/sphinx/pull/11774.patch

+ 

  BuildArch:     noarch

  

  BuildRequires: make
@@ -398,6 +402,9 @@ 

  

  

  %changelog

+ * Tue Dec 12 2023 Karolina Surma <ksurma@redhat.com> - 1:7.2.6-4

+ - Fix the tests run when building with Python 3.11.7, 3.12.1 and later

+ 

  * Thu Nov 16 2023 Miro Hrončok <mhroncok@redhat.com> - 1:7.2.6-3

  - On Fedora, BuildRequire the sphinxcontrib packages to build the documentation

  

no initial comment

Build succeeded.
https://fedora.softwarefactory-project.io/zuul/buildset/db217fa38f424fe0b935e0b9bab37433

OK, I don't expect a swift upstream response, so feel free to ship it :)

Pull-Request has been merged by ksurma

6 months ago
Metadata