Skip to content

Commit 8275740

Browse files
avalentinoap--
andauthored
New pytest mark for tests accessing to the network (#549)
* New pytest mark for tests accessing to teh network * Typo * test: import error skip overrides network marker Add network pytest mark for test_http.py --------- Co-authored-by: Andreas Poehlmann <ap--@users.noreply.github.com>
1 parent 3093b23 commit 8275740

3 files changed

Lines changed: 12 additions & 6 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ addopts = "-ra -m 'not hdfs' -p no:pytest-mypy-plugins"
128128
markers = [
129129
"hdfs: mark test as hdfs",
130130
"pathlib: mark cpython pathlib tests",
131+
"network: mark test as requiring access to the internet",
131132
]
132133

133134
[tool.coverage.run]

upath/tests/implementations/test_github.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,16 @@
1414
from ..utils import OverrideMeta
1515
from ..utils import overrides_base
1616

17-
pytestmark = pytest.mark.skipif(
18-
os.environ.get("CI", False)
19-
and not (
20-
platform.system() == "Linux" and sys.version_info[:2] in {(3, 9), (3, 13)}
17+
pytestmark = [
18+
pytest.mark.skipif(
19+
os.environ.get("CI", False)
20+
and not (
21+
platform.system() == "Linux" and sys.version_info[:2] in {(3, 9), (3, 13)}
22+
),
23+
reason="Skipping GitHubPath tests to prevent rate limiting on GitHub API.",
2124
),
22-
reason="Skipping GitHubPath tests to prevent rate limiting on GitHub API.",
23-
)
25+
pytest.mark.network,
26+
]
2427

2528

2629
def xfail_on_github_connection_error(func):

upath/tests/implementations/test_http.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
from ..utils import skip_on_windows
1414
from ..utils import xfail_if_no_ssl_connection
1515

16+
pytestmark = pytest.mark.network
17+
1618
try:
1719
get_filesystem_class("http")
1820
except ImportError:

0 commit comments

Comments
 (0)