allure-python-commons is a core Python library providing the API for end-users and helper functions/classes to build Allure adapters for various Python test frameworks. It is currently at version 2.15.3 and maintains a frequent release cadence with multiple minor/patch releases every few weeks or months, ensuring active development and support.
pip install allure-python-commonsVerified import paths — ran on the pinned version, not inferred.
This example demonstrates basic usage of `allure.step` and `allure.attach` within a Python function. While `allure-python-commons` provides the API, generating an actual Allure Report requires integration with a test framework adapter (like `allure-pytest`) and the Allure Report command-line tool. The output will typically be `.json` and `.xml` files in a designated directory, which are then processed by the Allure CLI tool.
Upgrade Python to 3.8 or later, or use an older version of `allure-python-commons` compatible with Python 3.7 (e.g., <2.14.0).
Ensure you are using `allure-pytest` (or another official adapter) and `allure-python-commons` together, and uninstall any legacy `pytest-allure-adaptor` plugins. Keep all `allure-framework` related packages updated to compatible versions.
For visible categorization in the report, use standard labels like `severity`, `epic`, `feature`, `story`, `tag` which have dedicated sections. If custom labels are required for display, consider custom report transformations or use Allure TestOps integration.
Install `allure-pytest` (or your framework's adapter) via `pip install allure-pytest` and the Allure Report CLI tool (e.g., via `brew install allure` or by downloading from GitHub and ensuring Java is installed). Then run your tests with the adapter and generate the report using `allure generate` or `allure serve`.
Upgrade all `allure-python` related packages (`allure-python-commons`, `allure-pytest`, etc.) to their latest compatible versions with your Pytest installation. The 2.x series resolved many of these issues.
Replace 'from allure.constants import AttachmentType' with 'from allure import attachment_type'.
Upgrade to Python 3.5 or higher to support type hints.
Install the Allure CLI by downloading it from the official Allure Report GitHub releases page or via a package manager (like Scoop on Windows, Homebrew on macOS, or apt/yum on Linux), then ensure its 'bin' directory is added to your system's PATH. For example, on Linux/macOS, you might add `export PATH=$PATH:/path/to/allure-commandline/bin` to your shell profile (.bashrc, .zshrc).
Ensure `allure-pytest` is installed (`pip install allure-pytest`). If it's already installed, try upgrading it and `allure-python-commons` (`pip install --upgrade allure-pytest allure-python-commons`). Instead of `pytest.allure.attach.file`, use `allure.attach.file` after importing `allure` directly: `import allure`.
For modern Allure Python integrations (Allure 2 and above), import `AttachmentType` from `allure_commons.types`. Replace `from allure.constants import AttachmentType` with `from allure_commons.types import AttachmentType`.
No dependency data recorded yet.