Allure pytest integration that generates comprehensive test reports with rich metadata and visual test execution tracking
—
Quality
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Command-line options for controlling Allure reporting behavior, output configuration, and basic test execution settings.
Configure where and how Allure test results are generated, including directory management and output cleanup.
--alluredir DIR
"""
Generate Allure report in the specified directory.
Parameters:
- DIR: Path to directory for Allure test results (may not exist)
Usage:
pytest --alluredir=./allure-results tests/
"""
--clean-alluredir
"""
Clean alluredir folder if it exists before generating new results.
Usage:
pytest --alluredir=./results --clean-alluredir tests/
"""Control what test output and logging information is attached to Allure reports.
--allure-no-capture
"""
Do not attach pytest captured logging/stdout/stderr to report.
By default, the plugin attaches:
- pytest captured stdout
- pytest captured stderr
- pytest captured logging
Usage:
pytest --alluredir=./results --allure-no-capture tests/
"""Control test execution based on Allure test plans and inversion logic.
--inversion
"""
Run tests NOT in testplan (inverse selection).
When a testplan is provided, normally only tests in the plan are executed.
This option runs all tests EXCEPT those in the testplan.
Usage:
pytest --alluredir=./results --inversion tests/
"""Configure URL patterns for different link types to enable short link references in tests.
--allure-link-pattern LINK_TYPE:LINK_PATTERN
"""
Define URL pattern for link type to enable short links in tests.
Parameters:
- LINK_TYPE: Type of link (e.g., 'issue', 'tms', 'test_case')
- LINK_PATTERN: Python format string with {} placeholder for link value
Usage:
pytest --allure-link-pattern issue:https://jira.company.com/browse/{} tests/
Then in tests:
@allure.link("PROJ-123", link_type="issue") # Expands to full URL
"""# Generate Allure results in specific directory
pytest --alluredir=./allure-results tests/
# Clean directory before generating results
pytest --alluredir=./results --clean-alluredir tests/
# Generate results without captured output
pytest --alluredir=./results --allure-no-capture tests/# Configure multiple link patterns
pytest \
--allure-link-pattern issue:https://jira.company.com/browse/{} \
--allure-link-pattern tms:https://testmanagement.company.com/test/{} \
--alluredir=./results tests/# Run only tests in test plan
ALLURE_TESTPLAN_FILE=testplan.json pytest --alluredir=./results tests/
# Run all tests EXCEPT those in test plan
ALLURE_TESTPLAN_FILE=testplan.json pytest --alluredir=./results --inversion tests/Install with Tessl CLI
npx tessl i tessl/pypi-allure-pytest