pytest-filter-subpackage is a simple plugin for the pytest framework, currently at version 0.2.0. It provides a convenient command-line option for filtering tests based on sub-package names, enabling users to efficiently run tests for specific parts of their codebase. The project is actively maintained, with recent releases focusing on compatibility with newer pytest versions and dependency management.
pip install pytest-filter-subpackageVerified import paths — ran on the pinned version, not inferred.
After installation, use the `-P` command-line option followed by a comma-separated list of sub-package names (without the top-level package name). For example, to run tests for `my_package.wcs` and `my_package.io.fits`, you would run `pytest -P wcs,io.fits` from your project root.
Upgrade `pytest-filter-subpackage` to `0.2.0` or a newer version using `pip install --upgrade pytest-filter-subpackage`.
Always provide only the sub-package name(s) relative to the top-level package, e.g., `pytest -P subpackage_name,another_subpackage`.
Ensure `packaging` is installed: `pip install packaging`.