3

I want o learn how to use python's coverage.py module to inspect the coverage pattern of my code. I tried reading about the tool from various sources and finally installed it on my windows 7 machine using 'pip' utility. After installation, the coverage module got installed in C:\Python27\Lib\site-packages.

Now, I was reading instructions on how to use it from this page : Author's Installation Notes. I followed the installation instructions as per given on this page. However, after I installed, I'm unsure of how to use the tool from commandline? According to author after pip install of the tool, one should be able to invoke the command

coverage --version 

and expect to see some output. However, when I run this command, I get command not found error. According to me this is expected behavior, since coverage is just another python module (i.e. has .py extension) and not a standalone executable. So, I don't know how it can be run in a standalone fashion.

Someone please provide exact details of installation of the tool. I just need help with installation. I'll learn the CMD usage from nedbatchelder.com's "Coverage command line usage" article.

2 Answers 2

6

When you installed coverage, you should have gotten files you can execute directly, installed into c:\Python27\Scripts. Make sure you configure your Windows environment so that that directory is on your path. Then you'll be able to use coverage as a command.

If you need help completing the Python installation on Windows, here are some detailed instructions.

Sign up to request clarification or add additional context in comments.

2 Comments

Oh. That's just downright silly of me. Thanks Ned for your instant response. I appreciate it.
Also, congratulations on turning 0x32.
3

You can use C:\Python27\python.exe -m coverage as a command too

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.