coveragepy
coveragepy copied to clipboard
I am writing unit test cases for python file using pytest framework
When I am trying to run the test case i am able to run it.using following command
pytest In the output I can see this test_sample.py 100%
When I am trying to run the following command to see whole line coverage
coverage run -m pytest I am getting below error Windows fatal exception: access violation when I hit coverage html It is saying no data to report Even . coverage file is also not generating. anyone please help me.
I suspect this is something to do with having more than one Python installation. For example, take a look at the output of these commands:
$ which pytest
$ which coverage
$ which python
The best practice is to always run python as the command:
$ python -m pip install ....
$ python -m pytest
$ python -m coverage run -m pytest
etc