Skip to content

Commit 0518560

Browse files
mceplalejandrogallo
authored andcommitted
Add net markers in tests to run pytest -k "not net"
1 parent 11f7e75 commit 0518560

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

setup.cfg

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ universal = 1
55
exclude = docs
66

77
[tool:pytest]
8-
collect_ignore = ['setup.py']
8+
markers =
9+
net: marks tests that call use the net (using the URL endpoint, deselect with '-k "not net"')
10+
911

1012
[mypy]
1113
disallow_redefinition = True

tests/test_doi.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import os
44
from pkg_resources import parse_version
55

6+
import pytest
7+
68
from doi import (
79
validate_doi, find_doi_in_text, __version__, pdf_to_doi,
810
get_real_url_from_doi
@@ -14,6 +16,7 @@ def test_valid_version() -> None:
1416
assert parse_version(__version__) >= parse_version("0.1.0")
1517

1618

19+
@pytest.mark.net
1720
def test_validate_doi() -> None:
1821
data = [
1922
('10.1063/1.5081715',
@@ -38,6 +41,7 @@ def test_validate_doi() -> None:
3841
assert str(e) == 'HTTP 404: DOI not found'
3942

4043

44+
@pytest.mark.net
4145
def test_get_real_url_from_doi() -> None:
4246
data = [
4347
('10.1016/S0009-2614(97)04014-1',

0 commit comments

Comments
 (0)