Registry / testing / pytest-only

pytest-only

JSON →
library2.1.2pypypiunverified

Pytest plugin that provides an @pytest.mark.only decorator to run a single test exclusively, ignoring all others. Current version 2.1.2, requires Python >=3.8, <4.0. Compatible with flake8 and pylint plugins to detect lingering only marks.

pip install pytest-only
INSTALL
IMPORT
SIG · PYTEST-ONLY
P
pytest-only
testingpythonv2.1.2
Install
2.8s avg
Import
Disk
29MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.1.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 30.6MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.8s · import 0.000s · 31MB
29MB installed
● package 29MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

only
from pytest_only import only
from pytest_only import only

The @pytest.mark.only decorator causes pytest to skip all other tests and run only the marked test.

import pytest def test_always(): assert 1 == 1 @pytest.mark.only def test_only_this(): assert 1 == 1 def test_never(): assert 1 == 2
Debug
Known issues
gotchaBeware of forgetting to remove @pytest.mark.only before committing. Use the flake8 or pylint plugins to catch such occurrences.
fix
Run flake8 with the plugin or use a pre-commit hook to detect 'only' marks.
affects: >=1.0.0, <=2.1.2
gotchaIf multiple tests have @pytest.mark.only, only the first encountered test runs (non-deterministic ordering).
fix
Ensure only one test has the @pytest.mark.only decorator at a time.
affects: >=1.0.0, <=2.1.2
Upgrade
Version history
2.1.2latest on PyPI · released May 27, 2024
Audit
Dependencies

No dependency data recorded yet.

Agent activity
16 hits · last 30 days
node
16
Resources
pytest-only — pip install pytest-only · libregistry