DEV Community

Discussion on: Automating your API tests using Python and Pytest

Collapse
 
ganeshpulsars profile image
Ganesh
pytest test.py --html-report=./report/report.html 
Enter fullscreen mode Exit fullscreen mode

this should be

pytest test.py --html=./report/report.html 
Enter fullscreen mode Exit fullscreen mode
Collapse
 
m4rri4nne profile image
Alicia Marianne 🇧🇷

How I used pytest-html-reporter library, the recommendation on the documentation is to run:

--html-report=./report/report.html

You can check here more about it:
github.com/prashanth-sams/pytest-h...

Collapse
 
navcheru profile image
Naveen • Edited

Somehow, I am getting errors if my response includes dates. For the time being, I am using --html=./report/report.html. I need to find an alternative way to see a good HTML report that can show results in a graphical manner.

Collapse
 
ganeshpulsars profile image
Ganesh

Python 3.9.7
Platform Windows-10-10.0.19045-SP0
Packages pytest: 7.4.3
pluggy: 1.0.0
Plugins html: 4.1.1
metadata: 3.0.0

The above is my environment and the --html-report=./report.html did not work in this environment.

BTW, Sorry I forgot to mention that your tutorial was excellent. Even though I have been using python for past twenty years, I understood and started using pytest only after reading this. Thanks for the simple and lucid tutorial