Skip to content

Erros with --xml-report behavior  #257

@sean-petal

Description

@sean-petal

Describe the Bug

The --xml-report option fails when the output report includes folders. It reports
ERROR: --xml-report must be a filename, not a path

for:
pytest --generate-xml --xml-report report_output/final_report.xml

While
pytest --generate-xml --xml-report final_report.xml

works fine.

Note: the documentation page is also incorrect -- it passes True to --generate-xml argument (which it can't handle) and then includes an example with a folder which fails. (link: https://github.com/reporterplus/pytest-html-plus/blob/main/docs/cli/generate-xml.rst)

To Reproduce

See description -- just run with a path in the filename for --xml-report

Command used:
See above

What actually happened:
ERROR: --xml-report must be a filename, not a path

Expected Behavior

It would allow me to specify an xml output inside a subfolder for better organization.

Environment

pytest-html-plus version 1.1.0
pytest version 9.0.3
Python version 3.12
OS Windows 11 or Linux (CI/CD)

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdocumentationImprovements or additions to documentation

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions