How to create HTML report showing only log messages and no stdout call (print statements of the code)

1k views Asked by At

I am learning pytest and logging using pycharm and python 3.9.6. I wanted to log the desired messages in the HTL report. I am using logging.getLogger(__name__) class for creating a logger object. all i wanted is to display only the log messages and no print statements from my code (showing as stdout call in my HTML report) in my HTML report.

I tried using --show-capture=log but i think it is only valid for failed tests. but in my case there is no failed tests. I am using --html=report.html cli command to generate report.

How can i generate a HTML report containg only log messages and no "Captured stdout call" as currently showing in my report? I want only the "Captured log call" in my report means only the logs that i am trying to print.

HTML Report image

0

There are 0 answers