Summary
Allow users to define reusable reporting configurations (profiles) in a TOML file and invoke them via:
pytest --plus-profile=<name>
Support profile definitions in:
- pyproject.toml under [tool.pytest-html-plus.profiles]
- Activate via:
- --plus-profile=ci=
- CLI flags must override profile values
- Backward compatible (no behavior change if profile not used)
Problem It Solves
What's the current limitation or pain point?
- CLI Duplication in CI
# pr.yml
run: pytest --html=report.html --json=report.json --screenshots=on-failure
# nightly.yml
run: pytest --html=nightly.html --json=nightly.json --screenshots=always
# release.yml
run: pytest --html=release.html --json=release.json --self-contained-html
Drift Between Local and CI
Developer runs this locally
pytest --html=local.html --screenshots=always
and then in CI
pytest --html=report.html --screenshots=on-failure
Configuration duplication and inconsistency across environments and pipelines.
Proposed Solution
Describe how you'd like it to work. If you have ideas on the API or CLI flags, show them:
Given a pyproject.toml file exists in project root
And contains [tool.pytest-html-plus.profiles.<profile_name>]
When user runs:
pytest --plus-profile=<profile_name>
Then:
The tool loads that profile
Applies the configuration values defined in it
Each profile key must map directly to existing CLI flags.
[tool.pytest-html-plus.profiles.ci]
html = "report.html"
json = "report.json"
screenshots = "on-failure"
Must behave identically to:
pytest --html-output=report.html --json-output=report.json --screenshots=on-failure --self-contained-html
Additional Context
Display errors when .toml malformed or invalid keys or multiple same keys in single profile
Summary
Allow users to define reusable reporting configurations (profiles) in a TOML file and invoke them via:
pytest --plus-profile=<name>Support profile definitions in:
Problem It Solves
What's the current limitation or pain point?
Drift Between Local and CI
Developer runs this locally
pytest --html=local.html --screenshots=alwaysand then in CI
pytest --html=report.html --screenshots=on-failureConfiguration duplication and inconsistency across environments and pipelines.
Proposed Solution
Describe how you'd like it to work. If you have ideas on the API or CLI flags, show them:
Given a pyproject.toml file exists in project root
And contains [tool.pytest-html-plus.profiles.<profile_name>]
When user runs:
pytest --plus-profile=<profile_name>Then:
The tool loads that profile
Applies the configuration values defined in it
Each profile key must map directly to existing CLI flags.
Must behave identically to:
pytest --html-output=report.html --json-output=report.json --screenshots=on-failure --self-contained-htmlAdditional Context
Display errors when
.tomlmalformed or invalid keys or multiple same keys in single profile