Pycharm 2.0 Coverage Usage

I'm trying to use Coverage in PyCharm 2.0. I'm reading the documenation and it talks about a Coverage tab in the Run/Debug Configuration, but I don't see any such tab. Anyone have a screen shot of what I'm supposed to see?

Regards,

Chris Johnson

10 comments

Unfortunately the documentation was not completely updated when we changed the UI. There is no "Code Coverage" tab and nothing to configure there. Simply press the "Run with Coverage" button to gather code coverage.

0

That makes me feel a little better. I was worried I was missing the obvious. Now that I know there isn't any such configuration, I need to know how to get coverage to work.

When I run it on one of my test classes I get the following:

/usr/local/bin/python /opt/pycharm-2.0/helpers/run_coverage.py run --omit=/opt/pycharm-2.0/helpers /opt/pycharm-2.0/helpers/pycharm/noserunner.py /work/andorian2/xsa/mgmt-common/common_platform/licensing/test/license_manager_tests.py
Testing started at 12:25 PM ...
no such option: --omit
Use 'coverage help' for help.
No data to report.

Process finished with exit code 0

If I select in the global settings to use the bundled coverage.py I get the following:

/usr/local/bin/python /opt/pycharm-2.0/helpers/run_coverage.py run --omit=/opt/pycharm-2.0/helpers /opt/pycharm-2.0/helpers/pycharm/noserunner.py /work/andorian2/xsa/mgmt-common/common_platform/licensing/test/license_manager_tests.py
Testing started at 12:32 PM ...
DJANGO_SETTINGS_MODULE=common_platform.smx_proj.settings
.
Coverage.py warning: Trace function changed, measurement is likely wrong: None

Process finished with exit code 0

What do I need to do to get this to show up in PyCharm?

Regard,

Chris Johnson

0

What version of coverage is installed in your environment?

To fix the problem please install newest version of coverage.py or enable 'Settings | Coverage | Use bundled coverage.py' option.

0

Dmitry,

Thanks for the quick reply, but if you look at my original post. I show the errors I get with the use bundle and not using bundle options for converage. So there must be something else I need to do to get it to work.

Chris

0

Sorry, missed the part of your message.

Wich version of coverage.py is installed to your system? I think installing the newest one should help.

0

503$chjohns2-lnx2:~ > coverage --v 
Coverage.py, version 3.3.1.  http://nedbatchelder.com/code/coverage

But if I use the built in python one does it matter? Shouldn't I have the correct version then?

Chris Johnson

0

Bundled coverage.py isn't working somehow on your system.

What are your OS and Python versions?

To run coverage in PyCharm now you should uprade your coverage.py to version 3.5.1.

0

Python 2.6.6 on Red Hat Linux 5.5. I not sure I can upgrade the local coverage version since the offical build scripts use it, but if in PyCharm I want to use it, why would the bundled coverage tool fail.

Regards,

Chris Johnson

0

I've created an issue regarding working with coverage 3.3.1 http://youtrack.jetbrains.net/issue/PY-5360

Do you use method sys.settrace in your project?

0

I did a quick search for sys.settrace and we use it in one place, but I don't believe that is being called at all one the file that I'm testing.

I used easy_install and it upgraded to coverage 3.4 (not sure why it didn't upgrade to 3.5.1), and made sure I unchecked the use bundled coverage. Now when I run my test with coverage I don't see any errors, but I don't see any mark up of my code in PyCharm indicating that any coverage happened.

usr/local/bin/python /opt/pycharm-2.0/helpers/run_coverage.py run --omit=/opt/pycharm-2.0/helpers /opt/pycharm-2.0/helpers/pycharm/noserunner.py /work/andorian2/xsa/mgmt-common/common_platform/licensing/test/license_manager_tests.py
Testing started at 9:46 AM ...
DJANGO_SETTINGS_MODULE=common_platform.smx_proj.settings
.
Process finished with exit code 0

Regards,

Chris Johnson

0

Please sign in to leave a comment.