How to save pytest’s results/logs to a file?

It appears that all of your test output is going stdout, so you simply need to “redirect” your python invocation’s output there:

python test_out.py >myoutput.log

You can also “tee” the output to multiple places. E.g., you might want to log to the file yet also see the output on your console. The above example then becomes:

python test_out.py | tee myoutput.log

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)