How do I attach log files in the HTML report generated while running pytest using pytest --html=report.html command? test_addition.py: def test_addition(): fh = open("a.log") # write to above log file and save fh.close() assert 1 + 1 == 2 Command: pytest --html=report.html I want the log file a.log attached as a link in the HTML report generated by pytest. Continue reading...