W
W
wutiarn2015-08-04 03:02:10
Python
wutiarn, 2015-08-04 03:02:10

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.
f48f15efe7c2457d83219fd256abb4a5
One of the tests was not executed at all:
3841bfc98589473ea8a58f92eafee254
Naturally, all the tests were run successfully:
a7be8101152046bc897dbf1910285ca8
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:
ef13114dfa4246e1a569285ff79b22e7
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:
69c89be65b774286858926c726d309d0
But if we create a small file that does nothing, then a miracle will happen:
c65e7959a5424aa4bb0b191aeebc4a39
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

3 answer(s)
M
maxclax, 2015-08-13
@maxclax

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.

S
Shmele, 2015-08-13
@shmele

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.

Николай Карелин, 2015-08-16
@nikolay_karelin

А что говорят разработчики? На такое ИМХО можно баг критический завести, даже если Community версия.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question