--- id: pytest-filter-subpackage version: "0.2.0" license: BSD license_treatment: permissive maintenance: active --- # pytest-filter-subpackage — Pytest plugin for filtering based on sub-packages License: permissive · Maintenance: active · Downloads: 334.7K/mo ## What it is and what it does pytest-filter-subpackage is a pytest plugin that simplifies running tests for specific sub-packages within a larger project. Instead of writing out glob patterns like `**/wcs **/io/fits`, you pass a comma-separated list of sub-package names to the `-P` option, and the plugin translates that into the appropriate test discovery paths. It depends on pytest and packaging. The plugin is designed for projects with nested package structures where you want to test a particular sub-package and its documentation together. It integrates with pytest's discovery mechanism and is automatically registered when installed. The fact sheet indicates it supports Python 3.8 through 3.12 and is actively maintained. Use it for: - Run tests for a single sub-package in a large monorepo without writing complex glob patterns. - Test both code and narrative documentation for a specific sub-package when used with pytest-doctestplus. - Quickly validate changes to a particular namespace within a multi-level package structure. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A pytest plugin that adds a `-P` option to run tests for specific sub-packages by name, filtering test discovery to match named sub-package paths. Yes, if you work with pytest projects that have nested sub-packages and want a simpler way to filter test runs. The plugin is lightweight, actively maintained, has no known vulnerabilities, and carries a permissive license. Install friction is minimal. It's most valuable in projects where you frequently test individual sub-packages. ## Install pip install pytest-filter-subpackage uv add pytest-filter-subpackage poetry add pytest-filter-subpackage ## Installing pytest-filter-subpackage Before you install: Low friction install as a pure Python wheel with only pytest and packaging as runtime dependencies. Actively maintained with recent commits and stable status. License in practice: BSD permissive license allows commercial and private use with minimal restrictions; you must retain the license notice. Quickstart: pip install pytest-filter-subpackage # Then run pytest with the -P option: pytest -P wcs,io.fits Verify before relying: - Whether the plugin works correctly with pytest-doctestplus as mentioned in the description, or if that integration requires additional setup. - Whether the -P option supports glob patterns or only exact sub-package name matching. ## Package facts - License: BSD (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 334.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pytest sub-package filtering, pytest plugin selective testing, pytest -P option, pytest namespace filtering, pytest subpackage runner, pytest-plugin, test-filtering [View on SkillFed](https://skillfed.io/packages/pytest-filter-subpackage) · [View on PyPI](https://pypi.org/project/pytest-filter-subpackage/)