File mark-network-tests.patch of Package papis
---
setup.cfg | 2 ++
tests/downloaders/test_usenix.py | 1 +
tests/test_arxiv.py | 4 ++++
tests/test_dblp.py | 3 +++
4 files changed, 10 insertions(+)
--- a/setup.cfg
+++ b/setup.cfg
@@ -16,6 +16,8 @@ addopts = --doctest-modules
doctest_optionflags = NORMALIZE_WHITESPACE ELLIPSIS
norecursedirs = .git doc build dist
python_files = *.py
+markers =
+ network: tests requiring network connection
[mypy]
strict = True
--- a/tests/downloaders/test_usenix.py
+++ b/tests/downloaders/test_usenix.py
@@ -39,6 +39,7 @@ def test_usenix_match() -> None:
assert Downloader.match(url) is None
+@pytest.mark.network
@testlib.with_default_config
@pytest.mark.parametrize("url", USENIX_LINK_URLS)
def test_usenix_fetch(monkeypatch, url: str) -> None:
--- a/tests/test_arxiv.py
+++ b/tests/test_arxiv.py
@@ -1,3 +1,4 @@
+import pytest
import papis.downloaders
from papis.arxiv import (
Downloader, get_data, find_arxivid_in_text, validate_arxivid
@@ -5,6 +6,7 @@ from papis.arxiv import (
import papis.bibtex
+@pytest.mark.network
def test_general():
data = get_data(
author="Garnet Chan",
@@ -41,6 +43,7 @@ def test_match():
assert down.arxivid == "1701.08223v2"
+@pytest.mark.network
def test_downloader_getter():
url = "https://arxiv.org/abs/1001.3032"
downs = papis.downloaders.get_matching_downloaders(url)
@@ -57,6 +60,7 @@ def test_downloader_getter():
assert down.check_document_format()
+@pytest.mark.network
def test_validate_arxivid():
# good
validate_arxivid("1206.6272")
--- a/tests/test_dblp.py
+++ b/tests/test_dblp.py
@@ -1,3 +1,4 @@
+import pytest
import requests
import papis.dblp
@@ -27,6 +28,7 @@ def get(code: int, url: str) -> requests
return r
+@pytest.mark.network
@testlib.with_default_config
def test_valid_dblp_key(monkeypatch, has_connection: bool = True) -> None:
with monkeypatch.context() as m:
@@ -44,6 +46,7 @@ def test_valid_dblp_key(monkeypatch, has
assert not papis.dblp.is_valid_dblp_key(key)
+@pytest.mark.network
@testlib.with_default_config
def test_importer_match(monkeypatch, has_connection: bool = True) -> None:
with monkeypatch.context() as m: