Allure pytest integration provides a way to integrate the Allure Test Reporting Framework with pytest tests. It functions as a pytest plugin, automatically collecting test results and generating comprehensive, interactive reports. The library is actively maintained as part of the `allure-python` monorepo, with frequent minor releases, typically on a monthly or bi-monthly basis.
pip install allure-pytestVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates a basic pytest test file with Allure decorators. To generate the Allure report, first run pytest with the `--alluredir` option to create XML results. Then, use the `allure serve` command (from the separately installed Allure command-line tool) to process these XML files and open an interactive HTML report in your browser. The Allure command-line tool requires Java.
Upgrade to `allure-pytest` version 2.14.3 or higher to ensure fixture titles are correctly displayed in reports.
Run `pip uninstall pytest-allure-adaptor` before `pip install allure-pytest`.
Upgrade your Python environment to 3.8 or newer.
Download and install the Allure command-line tool (e.g., via Homebrew on macOS, or manually) and ensure Java is installed and accessible in your PATH.
Upgrade to `allure-pytest` version 2.15.0 or higher for accurate reporting of nested test classes.
Use explicit `allure.tag()` or `@allure.tag()` decorators for custom tags, or consider custom hooks if specific `pytest` markers still need to be mapped to Allure tags.
Replace 'from allure.constants import AttachmentType' with 'from allure import attachment_type'.
Use 'from allure import severity_level' instead of 'allure.severity_level'.
Install the module using 'pip install allure-python-commons'.
Downgrade pytest to a compatible version, such as 'pytest==8.0.0'.
Upgrade to Python 3.6 or higher to use allure-pytest.