skillfed

pytest-remotedata

Pytest plugin for controlling remote data access.

pytest-remotedata v0.4.2 429.0K downloads/30d#6,742 on PyPI24
Permissive license BSD-3-Clause Active released

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 on this page — 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

pytest-remotedata on PyPI

pip

pip install pytest-remotedata

uv

uv add pytest-remotedata

poetry

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 the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 2 — pytest, packaging
Maintenance actively maintained — 11 days since the last release
Last repo commit
First released
Downloads 429,009/month — #6,742 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pytest_remotedata-0.4.2-py3-none-any.whl

Keywords: remote, data, pytest, py.test

Development Status :: 5 - Production/StableFramework :: PytestIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: Software Development :: TestingTopic :: Utilities

Tags

pytest remote data access controlskip internet tests pytestmark tests requiring networkconditional test execution internetpytest internet connectivity plugin
pytest-plugintest-controlnetwork-isolation

More Utilities packages