Answer the question
In order to leave comments, you need to log in
Coverage in pycharm showing weather on mars?
Good afternoon. Are any of you using coverage in pycharm? I have a strong feeling that it really shows the weather on Mars: I launch the project, put a debug point in the function that processes the message from the client - the debugger works. I run it in coverage mode - it says that the processing function is not called at all. Although the server continues to process requests. Obviously something is wrong with coverage.
It's even more fun with tests. In some places it comes to the point of absurdity. There is a unit test, one method of two lines. One, according to coverage, is called, the second is not.
One of the tests was not executed at all:
Naturally, all the tests were run successfully:
And now dessert. If we comment out all the tests, and leave only one, minor, which tests only 2 functions in utils, we get the following picture:
That is, even though there is simply nothing to pull the code, it is still "covered" (see the list of files project). And even the comments somehow managed to "fulfill". And somewhere even partially:
But if we create a small file that does nothing, then a miracle will happen:
Explain how this magic works? I've already broken my head against the wall. Invalidate caches & restart, deleted all files on a remote server (everything works through a remote interpreter, before Ubuntu in a container, in a virtual machine). I even demolished the container and rolled it out again (with reconfiguring the remote interpreter to unload pycharm_helpers). All folders with configs clambered in search of coverage cache. Nothing. Magic. I do not understand what is going on.
Answer the question
In order to leave comments, you need to log in
Under coverage, debug points are not needed. Where does the report fall with coverage? Perhaps it is broken ... I
recommend making a complete transition from testcase to py.test.
I can say that with py.test, coverege in PyCharm works correctly. Matches the results on Jenkins.
But my projects are run locally, not remotely in a container. Maybe that's the issue. Try to test locally.
With TestCases did not check.
А что говорят разработчики? На такое ИМХО можно баг критический завести, даже если Community версия.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question