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