--- id: pytest-tagging version: "1.6.0" license: MIT license_treatment: permissive maintenance: dormant --- # pytest_tagging — a pytest plugin to tag tests License: permissive · Maintenance: dormant · Downloads: 342.9K/mo ## What it is and what it does pytest-tagging is a pytest plugin that replaces the standard pytest.mark system with a simpler tagging mechanism. Instead of registering marks upfront, you decorate tests with @pytest.mark.tags() using any arbitrary strings—including variables from your codebase—and then filter test runs by those tags using command-line options like --tags and --exclude-tags. The plugin supports both OR (default) and AND logic for multiple tags, can combine tags into groups, and displays a count of failures per tag. It solves the friction of pytest's built-in mark registration, which requires pre-declaring marks and makes it awkward to use dynamic values. The plugin is lightweight (depends only on pytest), works across Python 3.8–3.13, and is thread-safe for parallel test execution. Use it for: - Organize integration, unit, and smoke tests by tag and run only the subset you need during development or CI. - Tag tests by component or feature (e.g., JIRA-XX, payment-module) and run all tests for a specific component. - Exclude flaky or slow tests from a test run using --exclude-tags without modifying test code. - Group related tests under a combined tag (e.g., 'all' = 'foo' + 'bar') and run them together. - Display all available tags in your test suite to discover what tags are in use. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A pytest plugin that lets you tag tests with arbitrary strings and select or exclude them by tag during test runs, with optional tag combination and counting. Yes, if you use pytest and find its mark registration cumbersome. The plugin is stable, permissively licensed, and has no known vulnerabilities. Dormant maintenance is not a concern here because the feature set is complete and the dependency surface is minimal. Install it when you want simpler, more flexible test filtering than pytest.mark provides. ## Install pip install pytest-tagging uv add pytest-tagging poetry add pytest-tagging ## Installing pytest_tagging Before you install: Low install friction; single dependency on pytest. Maintenance is dormant—last release was 644 days ago, but the repository is not archived and the latest commit is recent (2024-11-08), suggesting occasional updates without active development. License in practice: MIT license is permissive; you can use this package freely in commercial and private projects with minimal restrictions. Quickstart: pip install pytest-tagging In your test file: from pytest_tagging import combine_tags import pytest @pytest.mark.tags("integration", "smoke") def test_example(): assert True Run: pytest --tags integration Requires pytest to be installed; Python 3.8 or later. Verify before relying: - Thread-safety claim with pytest-parallel is stated in the description but not independently verified in the fact sheet. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 342.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pytest test tagging, tag tests in pytest, pytest tag filtering, select tests by tag, pytest test organization, exclude tests by tag, pytest tag management, pytest-plugin, test-filtering, test-organization [View on SkillFed](https://skillfed.io/packages/pytest-tagging) · [View on PyPI](https://pypi.org/project/pytest-tagging/)