pytest-dev / pytest-html

Plugin for generating HTML reports for pytest results
Other
700 stars 235 forks source link

support for pyproject.toml #839

Open 1Mark opened 6 days ago

1Mark commented 6 days ago

Hello!

pyproject.toml isn't supported and only pytest.ini to enable generate_report_on_test and I have an existing project that uses pyproject.toml with [tool.pytest.ini_options] since you can't use both at the same time, what would you recommend?

RonnyPfannschmidt commented 6 days ago

The ini option key in pyproject is equivalent to using pytest.ini

1Mark commented 5 days ago

The ini option key in pyproject is equivalent to using pytest.ini

That's what I thought but it didn't work.

RonnyPfannschmidt commented 5 days ago

https://github.com/pytest-dev/pytest-html/blob/master/src%2Fpytest_html%2Fplugin.py#L75-L80

Based on this code pyproject is supported

1Mark commented 5 days ago
[tool.pytest.ini_options]
addopts="--html=report.html --self-contained-html"

I managed to get it working via the above.

However, the below does not work

[tool.pytest.ini_options]
generate_report_on_test = "True"