]> git.pld-linux.org Git - packages/python-sphinxtesters.git/commitdiff
- disable pytest plugins
authorJakub Bogusz <qboosh@pld-linux.org>
Mon, 28 Mar 2022 16:58:12 +0000 (18:58 +0200)
committerJakub Bogusz <qboosh@pld-linux.org>
Mon, 28 Mar 2022 16:58:12 +0000 (18:58 +0200)
- added noconf patch for sphinx 4.x compatibility

python-sphinxtesters-noconf.patch [new file with mode: 0644]
python-sphinxtesters.spec

diff --git a/python-sphinxtesters-noconf.patch b/python-sphinxtesters-noconf.patch
new file mode 100644 (file)
index 0000000..9e947a3
--- /dev/null
@@ -0,0 +1,33 @@
+--- sphinxtesters-0.2.3/sphinxtesters/tests/test_pagebuilder.py.orig   2019-08-07 00:44:39.000000000 +0200
++++ sphinxtesters-0.2.3/sphinxtesters/tests/test_pagebuilder.py        2022-03-28 16:50:58.786025816 +0200
+@@ -3,10 +3,14 @@
+ from os.path import (dirname, join as pjoin, isdir, isfile)
++from sphinx.errors import ConfigError
++
++NO_CONFIG_ERRORS = (IOError, ConfigError)
+ try:  # Sphinx 1.8.0b1
+-    from sphinx.errors import ApplicationError as NoConfigError
++    from sphinx.errors import ApplicationError
++    NO_CONFIG_ERRORS = (IOError, ConfigError, ApplicationError)
+ except ImportError:
+-    from sphinx.errors import ConfigError as NoConfigError
++    pass
+ from sphinxtesters.sphinxutils import PageBuilder
+@@ -81,10 +85,10 @@ def test_bad_pagebuilder():
+         def set_page_source(cls):
+             cls.page_source = HERE
+-    # ConfigError as of Sphinx 1.6.6
+-    # ApplicationError as of 1.8.0b1
++    # ConfigError as of Sphinx 1.6.6 or 4.5.0
++    # ApplicationError as of 1.8.0b1-3.5.x
+     # See imports.
+-    with pytest.raises((IOError, NoConfigError)):
++    with pytest.raises(NO_CONFIG_ERRORS):
+         TestBadPageBuilder.setup_class()
index be2534b11b35489797ae6648be593564160ec5af..d4f3c8da549fbd6515de6aa91aba437e5d1293e4 100644 (file)
@@ -1,6 +1,6 @@
 #
 # Conditional build:
-%bcond_without tests   # unit tests
+%bcond_without tests   # unit tests [py3 tests fail with sphinx3.x+docutils0.18 combo]
 %bcond_without python2 # CPython 2.x module
 %bcond_without python3 # CPython 3.x module
 
@@ -14,6 +14,7 @@ Group:                Libraries/Python
 #Source0Download: https://pypi.org/simple/sphinxtesters/
 Source0:       https://files.pythonhosted.org/packages/source/s/sphinxtesters/sphinxtesters-%{version}.tar.gz
 # Source0-md5: 3df3720ba757d3d8270fed5aff622852
+Patch0:                %{name}-noconf.patch
 URL:           https://pypi.org/project/sphinxtesters/
 %if %{with python2}
 BuildRequires: python-modules >= 1:2.7
@@ -59,18 +60,25 @@ Narzędzia do testowania rozszerzeń Sphinksa.
 
 %prep
 %setup -q -n sphinxtesters-%{version}
+%patch0 -p1
 
 %build
 %if %{with python2}
 %py_build
 
-%{?with_tests:%{__python} -m pytest sphinxtesters/tests}
+%if %{with tests}
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+%{__python} -m pytest sphinxtesters/tests
+%endif
 %endif
 
 %if %{with python3}
 %py3_build
 
-%{?with_tests:%{__python3} -m pytest sphinxtesters/tests}
+%if %{with tests}
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+%{__python3} -m pytest sphinxtesters/tests
+%endif
 %endif
 
 %install
This page took 0.239356 seconds and 4 git commands to generate.