From 96d010c0f2f7f9d094a9fc13e6c53628e32c73b74e70b98914637bbdb4b72eff Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 23 Apr 2021 14:24:54 +0000 Subject: [PATCH] - Add no-net-tests.patch which marks tests requiring network (gh#agronholm/sphinx-autodoc-typehints#174). OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-sphinx-autodoc-typehints?expand=0&rev=17 --- no-net-tests.patch | 36 +++++++++++++++++++++++++ python-sphinx-autodoc-typehints.changes | 6 +++++ python-sphinx-autodoc-typehints.spec | 9 ++++--- 3 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 no-net-tests.patch diff --git a/no-net-tests.patch b/no-net-tests.patch new file mode 100644 index 0000000..d89bb79 --- /dev/null +++ b/no-net-tests.patch @@ -0,0 +1,36 @@ +--- + setup.cfg | 2 ++ + tests/test_sphinx_autodoc_typehints.py | 4 ++++ + 2 files changed, 6 insertions(+) + +--- a/setup.cfg ++++ b/setup.cfg +@@ -43,6 +43,8 @@ max-line-length = 99 + [tool:pytest] + addopts = -rsx --tb=short + testpaths = tests ++markers = ++ network: marks tests which require network connection + + [egg_info] + tag_build = +--- a/tests/test_sphinx_autodoc_typehints.py ++++ b/tests/test_sphinx_autodoc_typehints.py +@@ -95,6 +95,8 @@ def test_parse_annotation(annotation, mo + assert get_annotation_args(annotation, module, class_name) == args + + ++# requires inv fixtures which doesn't work without network connection ++@pytest.mark.network + @pytest.mark.parametrize('annotation, expected_result', [ + (str, ':py:class:`str`'), + (int, ':py:class:`int`'), +@@ -177,6 +179,8 @@ def test_format_annotation(inv, annotati + assert m.group('role') == expected_role + + ++# requires inv fixtures which doesn't work without network connection ++@pytest.mark.network + @pytest.mark.parametrize('library', [typing, typing_extensions], + ids=['typing', 'typing_extensions']) + @pytest.mark.parametrize('annotation, params, expected_result', [ diff --git a/python-sphinx-autodoc-typehints.changes b/python-sphinx-autodoc-typehints.changes index 5a41e05..52e1880 100644 --- a/python-sphinx-autodoc-typehints.changes +++ b/python-sphinx-autodoc-typehints.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Apr 23 14:24:23 UTC 2021 - Matej Cepl + +- Add no-net-tests.patch which marks tests requiring network + (gh#agronholm/sphinx-autodoc-typehints#174). + ------------------------------------------------------------------- Wed Sep 23 13:29:55 UTC 2020 - Dirk Mueller diff --git a/python-sphinx-autodoc-typehints.spec b/python-sphinx-autodoc-typehints.spec index 11aca73..cb17239 100644 --- a/python-sphinx-autodoc-typehints.spec +++ b/python-sphinx-autodoc-typehints.spec @@ -1,7 +1,7 @@ # # spec file for package python-sphinx-autodoc-typehints # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -26,6 +26,9 @@ License: MIT Group: Development/Languages/Python URL: https://github.com/agronholm/sphinx-autodoc-typehints Source: https://files.pythonhosted.org/packages/source/s/sphinx-autodoc-typehints/sphinx-autodoc-typehints-%{version}.tar.gz +# PATCH-FIX-UPSTREAM no-net-tests.patch gh#agronholm/sphinx-autodoc-typehints#174 mcepl@suse.com +# skip network tests +Patch0: no-net-tests.patch BuildRequires: %{python_module setuptools >= 36.2.7} BuildRequires: %{python_module setuptools_scm >= 1.7.0} BuildRequires: fdupes @@ -48,7 +51,7 @@ This is a Sphinx extension which allows to use Python 3 annotations for document and return value types of functions. %prep -%setup -q -n sphinx-autodoc-typehints-%{version} +%autosetup -p1 -n sphinx-autodoc-typehints-%{version} %build %python_build @@ -59,7 +62,7 @@ and return value types of functions. %check # test_sphinx_output -- too depenedent on sphinx version available -%pytest -k 'not test_sphinx_output' +%pytest -k 'not (test_sphinx_output or network)' %files %{python_files} %{python_sitelib}/*