pytest-only
Use @pytest.mark.only to run a single test
Decision gist · record as of 2026-08-14
Yes, if you use pytest and want a lightweight way to focus on individual tests during development. The plugin is stable, has no security vulnerabilities, and adds minimal friction (only pytest as a dependency). Dormant maintenance is not a concern for a narrow, stable tool, but verify compatibility with your pytest version if you run a very recent release.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction install with only pytest as a runtime dependency.
- Maintenance is dormant (last release 2024-05-27, 809 days ago), but the package is marked Production/Stable and the repository is not archived, suggesting it remains functional for its narrow scope.
License · maintenance · safety
MIT (permissive) — MIT license is permissive, allowing unrestricted use, modification, and distribution in both open-source and commercial projects.
last release 2024-05-27 (809 days) · last repo commit 2025-01-13 · 19 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 76,871 downloads/mo, #14,585 on PyPI
Alternatives
Verify before relying
pip install pytest-only
import pytest
@pytest.mark.only
def test_focused():
assert True
# Run with: pytest- Whether the plugin remains compatible with pytest versions released after 2024-05-27
- Whether the bundled pylint checker (pytest_only.ext.pylint) is actively maintained
What it is and what it does
pytest-only is a pytest plugin that selectively runs only the tests you mark with @pytest.mark.only, skipping all unmarked tests in the same run. If no tests are marked, all tests run normally. You can apply the marker to individual test functions, entire test classes, or at the module level via pytestmark. The plugin also includes a pylint checker to warn against accidentally committing focused tests.
The package is a thin wrapper around pytest's marker system, designed for development workflows where you want to isolate a single test or a small subset without modifying your test suite structure. It borrows the concept from mocha's .only pattern and provides a --no-only flag to temporarily disable the filtering behavior.
Use it for
- Isolate a failing test during debugging without commenting out or deleting other tests
- Focus on a specific test class or module during active development
- Temporarily run only new tests while implementing a feature, then remove the marker before commit
- Use the bundled pylint plugin to catch stray @pytest.mark.only markers before they reach version control
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you use pytest and want a lightweight way to focus on individual tests during development.
The plugin is stable, has no security vulnerabilities, and adds minimal friction (only pytest as a dependency). Dormant maintenance is not a concern for a narrow, stable tool, but verify compatibility with your pytest version if you run a very recent release.
Install
pytest-only on PyPI
Before you install
Low friction install with only pytest as a runtime dependency. Maintenance is dormant (last release 2024-05-27, 809 days ago), but the package is marked Production/Stable and the repository is not archived, suggesting it remains functional for its narrow scope.
License in practice
MIT license is permissive, allowing unrestricted use, modification, and distribution in both open-source and commercial projects.
Quickstart
pip install pytest-only
import pytest
@pytest.mark.only
def test_focused():
assert True
# Run with: pytest
Verify before relying
- Whether the plugin remains compatible with pytest versions released after 2024-05-27
- Whether the bundled pylint checker (pytest_only.ext.pylint) is actively maintained
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release <4.0,>=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagepytest |
| Maintenance | Dormant 809 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 76,871 / month, #14,585 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableFramework :: PytestLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Testing |
Evidence: pytest_only-2.1.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “run only marked tests pytest”
- pytest-onlyA pytest plugin that runs only tests marked with @pytest.mark.only,…
- pytest-skip-slowA pytest plugin that skips tests marked with `@pytest.mark.slow` or…
- pytest-error-for-skipsA pytest plugin that converts skipped tests into test failures,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Testing packages
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.
Install it if you write tests for any asyncio-based code.
A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.
Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.
See also pytest-skip-slow · pytest-timestamper · pytest-skip-markers · pytest-picked · tavern · pytest-dependency · pytest-mpi · pytest-enabler · pytest-filter-subpackage · pytest-cache