Py.Test : Reporting and HTML output

前端 未结 3 700
北恋
北恋 2021-02-19 01:34

This is not a technical question at all really. However, I can not locate my .HTML report that is supposed to be generated using:

py.test --cov-report htm

3条回答
  •  独厮守ぢ
    2021-02-19 02:26

    If you want to generate report in html, give full file path of the test file.

    py.test --cov-report html test_file_name.py --cov=/home/ubuntu/venv/python3/lib/python3.7/site-packages/test/
    

    Then start a python server

    python -m http.server 
    

    Navigate to the html file in htmlcov directory

    http://0.0.0.0:8000/venv/python3/lib/python3.7/site-packages/htmlcov/
    

    You will see the report

提交回复
热议问题