Coverage for tests with pytest

Answered


So I have a project with tests written using pytest, I created a Run config and I'm able to run the tests perfectly from inside PyCharm. But when I try to "run tests with coverage" I don't see any coverage results. (I did install the coverage.py on prompt when I first tried to run the tests with coverage.py)

Here is my coverage settings,

The issue seems to be that the coverage runner can't find any suites,

I'm not sure if it is supposed to find the suites automatically, or how to add the coverage suite manually.

Thanks for the help

0
4 comments

Hi Sthapar! Do you use local interpreter or remote one?

0
Avatar
Permanently deleted user

I am not sure what exactly you mean by that but I am using this on my personal machine with a Python 3.6 interpreter installed locally on the system.

0

I see, sorry for confusing question! Would you mind creating ticket in our bug tracker and attaching idea.log file from Help | Show Log in ...?

0
Avatar
Permanently deleted user

My issue is slightly different, but I'm trying to run coverage using pytest, too.

In my case, the coverage tool is running just fine, but I want to limit the code that's included in the coverage stats (currently it's including all of python and all of site-packages).

This page said that there should be a configuration tab, code coverage tab, and logs tab visible in the run/debug configurations window: https://www.jetbrains.com/help/idea/run-debug-configuration-application.html#code-coverage

I only see the configuration tab and the logs tab.

4

Please sign in to leave a comment.