pytest-html icon indicating copy to clipboard operation
pytest-html copied to clipboard

Output the stdout in the use case to the console and html report at the same time

Open wangqian0818 opened this issue 4 years ago • 2 comments
trafficstars

I‘m useing pytest-html and find the plugin generally fantastic. But I have been in contact with pytest-html for a short time. During the use, I found that adding the'-s' parameter to the pytest command can display the standard output of the use case to the console, but the standard output of the html report cannot be captured. With the'--capture=sys' parameter, the html report is captured, but the standard output in the console disappears. Is there any way to display it in the console and html report at the same time?

wangqian0818 avatar Jan 06 '21 08:01 wangqian0818

with pytest-html3.x.x -s --capture=sysgive you all. if you pytest-html 2.1.1 you can finegrain the various combinations

fenchu avatar Jan 14 '21 15:01 fenchu

We really miss ways to finegrain output. --capture=fd and tuning the logging so it only output a stderr files, no stdout file is my current workaround. But it is not sustainable because I like logging and output to be exactly like in production. (We often search for errors in test system if we see them in prod)

fenchu avatar Feb 12 '21 09:02 fenchu