{"id":1318,"library":"allure-pytest","title":"Allure pytest integration","description":"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.","status":"active","version":"2.15.3","language":"python","source_language":"en","source_url":"https://github.com/allure-framework/allure-python","tags":["testing","reporting","pytest","allure","qa"],"install":[{"cmd":"pip install allure-pytest","lang":"bash","label":"Install allure-pytest"}],"dependencies":[{"reason":"Required for test execution framework.","package":"pytest","optional":false},{"reason":"Common engine for all Allure Python integrations.","package":"allure-python-commons","optional":false},{"reason":"External tool required to generate and serve HTML reports. Requires Java Runtime Environment.","package":"allure-commandline","optional":false}],"imports":[{"note":"Primary import for Allure decorators and dynamic API functions.","symbol":"allure","correct":"import allure"},{"note":"Used for defining standard Allure labels programmatically.","symbol":"LabelType","correct":"from allure_commons.types import LabelType"}],"quickstart":{"code":"# test_example.py\nimport allure\nimport pytest\n\n@allure.epic(\"Web Testing\")\n@allure.feature(\"Login Functionality\")\ndef test_successful_login():\n    allure.dynamic.story(\"User can log in with valid credentials\")\n    with allure.step(\"Enter username and password\"):\n        print(\"Entering credentials...\")\n    with allure.step(\"Click login button\"):\n        print(\"Clicking login...\")\n    assert True\n\n@allure.epic(\"API Testing\")\n@allure.feature(\"User Management\")\ndef test_get_user_profile():\n    allure.dynamic.story(\"Retrieve user data via API\")\n    with allure.step(\"Send GET request to user endpoint\"):\n        print(\"Sending request...\")\n    with allure.step(\"Verify response status code\"):\n        print(\"Checking status...\")\n    with allure.step(\"Validate user data in response\"):\n        print(\"Validating data...\")\n    assert True\n\n# To run tests and generate Allure results:\n# pytest --alluredir=allure-results\n\n# To serve the Allure report (requires Allure command-line tool):\n# allure serve allure-results","lang":"python","description":"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."},"warnings":[{"fix":"Upgrade to `allure-pytest` version 2.14.3 or higher to ensure fixture titles are correctly displayed in reports.","message":"Older versions of `allure-pytest` (pre-2.14.3) may not correctly handle `allure.title` for fixtures when used with `pytest` version 8.4 or later.","severity":"breaking","affected_versions":"<2.14.3"},{"fix":"Run `pip uninstall pytest-allure-adaptor` before `pip install allure-pytest`.","message":"If you were previously using `pytest-allure-adaptor`, it must be uninstalled before installing `allure-pytest` due to conflicting implementations. The `allure-pytest` setup process will explicitly check for this conflict.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Upgrade your Python environment to 3.8 or newer.","message":"As of `allure-python` 2.14.0, official support for Python 3.7 has been dropped. Users on Python 3.7 will not receive updates or fixes for newer `allure-pytest` versions.","severity":"breaking","affected_versions":">=2.14.0"},{"fix":"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.","message":"The Allure Report command-line tool (required to generate and serve HTML reports) is a separate installation from `allure-pytest` and requires a Java Runtime Environment (JRE) to function.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Upgrade to `allure-pytest` version 2.15.0 or higher for accurate reporting of nested test classes.","message":"In versions prior to 2.15.0, reports for tests defined within nested classes might have incorrect `fullName`, `historyId`, `testCaseId`, and `subSuite` values, leading to improper grouping and history tracking.","severity":"gotcha","affected_versions":"<2.15.0"},{"fix":"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.","message":"As of version 2.14.3, built-in (reserved) `pytest` markers are no longer converted into Allure tags. If your reporting workflow relied on these markers appearing as tags, this behavior has changed.","severity":"gotcha","affected_versions":">=2.14.3"}],"env_vars":null,"last_verified":"2026-05-20T04:25:23.928Z","next_check":"2026-07-08T00:00:00.000Z","problems":[{"fix":"Replace 'from allure.constants import AttachmentType' with 'from allure import attachment_type'.","cause":"The 'allure.constants' module has been deprecated and removed in newer versions of allure-pytest.","error":"ModuleNotFoundError: No module named 'allure.constants'"},{"fix":"Use 'from allure import severity_level' instead of 'allure.severity_level'.","cause":"The 'severity_level' attribute has been removed or renamed in recent versions of allure-pytest.","error":"AttributeError: module 'allure' has no attribute 'severity_level'"},{"fix":"Install the module using 'pip install allure-python-commons'.","cause":"The 'allure_commons' module is not installed or not found in the Python environment.","error":"ModuleNotFoundError: No module named 'allure_commons'"},{"fix":"Downgrade pytest to a compatible version, such as 'pytest==8.0.0'.","cause":"Incompatibility between allure-pytest and pytest versions due to changes in pytest's internal APIs.","error":"AttributeError: 'str' object has no attribute 'iter_parents'"},{"fix":"Upgrade to Python 3.6 or higher to use allure-pytest.","cause":"Attempting to run allure-pytest with an unsupported Python version, such as Python 2.7.","error":"SyntaxError: invalid syntax"}],"ecosystem":"pypi","meta_description":null,"install_score":100,"install_tag":"verified","quickstart_score":null,"quickstart_tag":null,"pypi_latest":"2.16.0","cli_name":"","cli_version":null,"type":"library","homepage":"https://allurereport.org/","github":"https://github.com/allure-framework/allure-python","docs":"https://allurereport.org/docs/pytest/","changelog":null,"pypi":"https://pypi.org/project/allure-pytest/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"install_checks":{"last_tested":"2026-05-20","tag":"verified","tag_description":"installs cleanly on critical runtimes, fast import, recently tested","installed_version":"2.16.0","pypi_latest":"2.16.0","is_stale":false,"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"allure-pytest","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.07,"mem_mb":2.6,"disk_size":"31.5M"},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"allure-pytest","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.07,"mem_mb":2.6,"disk_size":"31.3M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"allure-pytest","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.8,"import_time_s":0.05,"mem_mb":2.6,"disk_size":"32M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"allure-pytest","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.05,"mem_mb":2.6,"disk_size":"32M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"allure-pytest","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.11,"mem_mb":2.9,"disk_size":"34.5M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"allure-pytest","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.13,"mem_mb":2.9,"disk_size":"34.3M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"allure-pytest","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.6,"import_time_s":0.1,"mem_mb":2.9,"disk_size":"35M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"allure-pytest","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.1,"mem_mb":2.9,"disk_size":"35M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"allure-pytest","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.09,"mem_mb":2.9,"disk_size":"26.1M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"allure-pytest","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.1,"mem_mb":2.9,"disk_size":"25.8M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"allure-pytest","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.6,"import_time_s":0.12,"mem_mb":2.9,"disk_size":"27M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"allure-pytest","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.1,"mem_mb":2.9,"disk_size":"26M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"allure-pytest","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.09,"mem_mb":3.1,"disk_size":"25.9M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"allure-pytest","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.1,"mem_mb":3.1,"disk_size":"25.5M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"allure-pytest","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.5,"import_time_s":0.1,"mem_mb":2.9,"disk_size":"26M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"allure-pytest","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.1,"mem_mb":2.9,"disk_size":"26M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"allure-pytest","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.06,"mem_mb":2.5,"disk_size":"30.8M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"allure-pytest","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.07,"mem_mb":2.5,"disk_size":"30.6M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"allure-pytest","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":3.2,"import_time_s":0.06,"mem_mb":2.5,"disk_size":"31M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"allure-pytest","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.06,"mem_mb":2.5,"disk_size":"31M"}]},"quickstart_checks":{"last_tested":"2026-04-24","tag":null,"tag_description":null,"results":[{"runtime":"python:3.10-alpine","exit_code":0},{"runtime":"python:3.10-slim","exit_code":0},{"runtime":"python:3.11-alpine","exit_code":0},{"runtime":"python:3.11-slim","exit_code":0},{"runtime":"python:3.12-alpine","exit_code":0},{"runtime":"python:3.12-slim","exit_code":0},{"runtime":"python:3.13-alpine","exit_code":0},{"runtime":"python:3.13-slim","exit_code":0},{"runtime":"python:3.9-alpine","exit_code":0},{"runtime":"python:3.9-slim","exit_code":0}]},"_links":{"self":"https://checklist.day/api/registry/allure-pytest","v1":"https://checklist.day/v1/registry/allure-pytest","v1_install":"https://checklist.day/v1/registry/allure-pytest/install","v1_imports":"https://checklist.day/v1/registry/allure-pytest/imports","v1_compatibility":"https://checklist.day/v1/registry/allure-pytest/compatibility","v1_quickstart":"https://checklist.day/v1/registry/allure-pytest/quickstart","docs":"https://checklist.day/docs"}}