Compatibility with pytest >=8
After some more fiddling, the incompatibility might come from pytest-metadata and pytest... it seems pytest-metadata doesn't support pytest >= 8.0.0 yet, and that makes the report generation fail for some reason.
Originally posted by @supermete in https://github.com/pytest-dev/pytest-html/issues/809#issuecomment-2067984348
@BeyondEvil turns out that the issue came from how I inserted data in pytest_html_results_table_html. With previous versions, I was using py.xml.html to insert a table in data like this:
def pytest_html_results_table_html(report, data):
data.insert(0, html.table( ... ))
That used to work but now it's not, it expects a string instead. Converting html.table into a string gets rid of the error.
I still can't have a proper report though. The only result I'm getting is an empty table with a green button saying that "There are still tests running". While I can clearly see in the stdout that the tests are finished.
Sorry I hadn't see that you created this ticket to follow-up on this. I opened a separate ticket for the issue I'm having now: https://github.com/pytest-dev/pytest-html/issues/810