How to display pytest warnings in the generated HTML report?

Viewed 145

I'm using pytest and pytest-html to generate reports. Having just found out about warnings, I'd like to have the warnings that I generate in tests with

warnings.warn(UserWarning(f'Whoops!'))

be shown somewhere in the generated HTML test report. At the moment, they're just shown in the console and I can't see an obvious way to achieve this. Can anyone help?

0 Answers
Related