--- id: pytest-remotedata version: "0.4.2" license: BSD-3-Clause license_treatment: permissive maintenance: active --- # pytest-remotedata — Pytest plugin for controlling remote data access. License: permissive · Maintenance: active · Downloads: 429.0K/mo ## What it is and what it does pytest-remotedata is a pytest plugin that provides decorators to mark tests that require internet access or should run only when offline. It originated in the astropy package but is now standalone for general use. The plugin adds a --remote-data command-line option to pytest, allowing you to control whether remote-data tests execute, skip, or run only for specific data sources (like astropy). By default, marked tests are skipped, keeping local test runs fast; you opt in to running them with explicit flags. The plugin is useful when your package has features that depend on downloading data or calling external APIs, but you want those tests isolated from your regular test suite. It lets you mark individual test functions, methods, or classes with @pytest.mark.remote_data or @pytest.mark.internet_off, then control their execution from the command line without editing test code. It also supports strict mode to catch accidental network access in unmarked tests. Use it for: - Mark tests that download datasets or call external APIs, then skip them in CI to keep builds fast. - Run only internet-dependent tests on demand with --remote-data, keeping local development cycles quick. - Enforce that unmarked tests never access the network by enabling strict mode in setup.cfg. - Organize tests by data source (e.g., --remote-data=astropy) to run only tests for specific providers. - Test offline behavior by running only @pytest.mark.internet_off tests to verify graceful degradation. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A pytest plugin that lets you mark and selectively run tests requiring internet access, skipping them by default to speed up local test suites. Yes. This is a lightweight, actively maintained plugin with no security vulnerabilities, permissive licensing, and low install friction. It solves a real problem for packages with internet-dependent tests. Install it if your test suite includes tests that access remote data and you want to keep local runs fast. ## Install pip install pytest-remotedata uv add pytest-remotedata poetry add pytest-remotedata ## Installing pytest-remotedata Before you install: Low friction install with only pytest and packaging as dependencies. Actively maintained with a release 11 days ago; supports current Python versions (3.9 through 3.14). License in practice: BSD-3-Clause is permissive; you can use this in commercial projects with minimal restrictions, provided you include the license notice. Quickstart: pip install pytest-remotedata import pytest from urllib.request import urlopen @pytest.mark.remote_data def test_remote_data(): urlopen('https://example.org') # Run with: pytest --remote-data Verify before relying: - Whether strict remote data checking (remote_data_strict) works with all test runners or only specific configurations. - Performance impact of the plugin on large test suites with many marked tests. ## Package facts - License: BSD-3-Clause (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 429.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pytest remote data access control, skip internet tests pytest, mark tests requiring network, conditional test execution internet, pytest internet connectivity plugin, pytest-plugin, test-control, network-isolation [View on SkillFed](https://skillfed.io/packages/pytest-remotedata) · [View on PyPI](https://pypi.org/project/pytest-remotedata/)