diff --git a/pyproject.toml b/pyproject.toml index 3e1f6503..aa9e96f0 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", + "network: 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..3279c47a 100644 --- a/upath/tests/implementations/test_http.py +++ b/upath/tests/implementations/test_http.py @@ -13,6 +13,8 @@ from ..utils import skip_on_windows from ..utils import xfail_if_no_ssl_connection +pytestmark = pytest.mark.network + try: get_filesystem_class("http") except ImportError: