1
0

- 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
This commit is contained in:
Matej Cepl 2021-04-23 14:24:54 +00:00 committed by Git OBS Bridge
parent 278aec5722
commit 96d010c0f2
3 changed files with 48 additions and 3 deletions

36
no-net-tests.patch Normal file
View File

@ -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', [

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Apr 23 14:24:23 UTC 2021 - Matej Cepl <mcepl@suse.com>
- 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 <dmueller@suse.com>

View File

@ -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}/*