1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
From: Antonio Valentino <antonio.valentino@tiscali.it>
Date: Tue, 13 Jan 2026 00:28:49 +0000
Subject: Mark network tests
Forwarded: https://github.com/fsspec/universal_pathlib/pull/549
---
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 3e1f650..e2b4d58 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 5fda42f..4d35d0c 100644
--- a/upath/tests/implementations/test_github.py
+++ b/upath/tests/implementations/test_github.py
@@ -14,13 +14,16 @@ from ..cases import ReadablePathTests
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 66d76e6..aa4957e 100644
--- a/upath/tests/implementations/test_http.py
+++ b/upath/tests/implementations/test_http.py
@@ -18,6 +18,7 @@ try:
except ImportError:
pytestmark = pytest.mark.skip
+pytestmark = pytest.mark.network
@pytest.fixture
def internet_connection():
|