This pytest plugin provides a way to include diagnostic information about the system, Python installation, and select dependencies in the header of the test output. It is primarily optimized for use with Astropy-related projects but is designed to be usable with any package. The current version is 0.2.2, with releases typically tied to the needs and development cycle of the Astropy project.
pip install pytest-astropy-headerVerified import paths — ran on the pinned version, not inferred.
To enable and customize `pytest-astropy-header`, you typically place configuration in your project's `conftest.py` file. The plugin automatically registers when installed, but explicit configuration in `pytest_configure` ensures robust activation and allows for customization of the displayed package versions and modules.
Update your import statements in `conftest.py` from `from astropy.tests.plugins.display import ...` to `from pytest_astropy_header.display import ...`.
Ensure that your project's `astropy` dependency is version 4.0 or newer when using `pytest-astropy-header`.
Refer to the `quickstart` example for the correct pattern to modify `PYTEST_HEADER_MODULES` and `TESTED_VERSIONS` dictionaries. The dictionary keys for `PYTEST_HEADER_MODULES` should be the desired display name, and values should be the Python module name.