{"id":21807,"library":"pytest-only","title":"pytest-only","description":"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.","status":"active","version":"2.1.2","language":"python","source_language":"en","source_url":"https://github.com/theY4Kman/pytest-only","tags":["pytest","pytest-plugin","testing","only"],"install":[{"cmd":"pip install pytest-only","lang":"bash","label":"Install from PyPI"}],"dependencies":null,"imports":[{"note":"Import pytest normally; no separate import needed.","wrong":null,"symbol":"pytest.mark.only","correct":"import pytest; @pytest.mark.only"}],"quickstart":{"code":"import pytest\n\ndef test_always():\n    assert 1 == 1\n\n@pytest.mark.only\ndef test_only_this():\n    assert 1 == 1\n\ndef test_never():\n    assert 1 == 2","lang":"python","description":"The @pytest.mark.only decorator causes pytest to skip all other tests and run only the marked test."},"warnings":[{"fix":"Run flake8 with the plugin or use a pre-commit hook to detect 'only' marks.","message":"Beware of forgetting to remove @pytest.mark.only before committing. Use the flake8 or pylint plugins to catch such occurrences.","severity":"gotcha","affected_versions":">=1.0.0, <=2.1.2"},{"fix":"Ensure only one test has the @pytest.mark.only decorator at a time.","message":"If multiple tests have @pytest.mark.only, only the first encountered test runs (non-deterministic ordering).","severity":"gotcha","affected_versions":">=1.0.0, <=2.1.2"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Install pytest and ensure the test file imports pytest.","cause":"pytest.mark.only requires the pytest.mark attribute, which may not be available if pytest is not imported correctly or installed.","error":"AttributeError: module 'pytest' has no attribute 'mark'"},{"fix":"Upgrade setuptools and reinstall pytest-only.","cause":"Outdated setuptools or incorrect plugin discovery.","error":"pluggy._manager.PluginValidationError: Plugin 'pytest_only' could not be loaded"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}