From 1e30189af1d701210b16191f7550a6d4c6e280a1 Mon Sep 17 00:00:00 2001 From: Antonio Valentino Date: Sun, 8 Feb 2026 19:42:07 +0100 Subject: [PATCH] New pytest mark for tests accessing to teh network --- pyproject.toml | 1 + upath/tests/implementations/test_github.py | 15 +++++++++------ upath/tests/implementations/test_http.py | 1 + 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3e1f6503..e2b4d58e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -128,6 +128,7 @@ addopts = "-ra -m 'not hdfs' -p no:pytest-mypy-plugins" markers = [ "hdfs: mark test as hdfs", "pathlib: mark cpython pathlib tests", + "natwork: mark test as requiring access to the internet", ] [tool.coverage.run] diff --git a/upath/tests/implementations/test_github.py b/upath/tests/implementations/test_github.py index 5fda42ff..4d35d0c8 100644 --- a/upath/tests/implementations/test_github.py +++ b/upath/tests/implementations/test_github.py @@ -14,13 +14,16 @@ from ..utils import OverrideMeta from ..utils import overrides_base -pytestmark = pytest.mark.skipif( - os.environ.get("CI", False) - and not ( - platform.system() == "Linux" and sys.version_info[:2] in {(3, 9), (3, 13)} +pytestmark = [ + pytest.mark.skipif( + os.environ.get("CI", False) + and not ( + platform.system() == "Linux" and sys.version_info[:2] in {(3, 9), (3, 13)} + ), + reason="Skipping GitHubPath tests to prevent rate limiting on GitHub API.", ), - reason="Skipping GitHubPath tests to prevent rate limiting on GitHub API.", -) + pytest.mark.network, +] def xfail_on_github_connection_error(func): diff --git a/upath/tests/implementations/test_http.py b/upath/tests/implementations/test_http.py index 66d76e62..aa4957e0 100644 --- a/upath/tests/implementations/test_http.py +++ b/upath/tests/implementations/test_http.py @@ -18,6 +18,7 @@ except ImportError: pytestmark = pytest.mark.skip +pytestmark = pytest.mark.network @pytest.fixture def internet_connection():