1

I have test.sh that runs python command on many different scripts. Is there a way to emit coverage -a for each python call without prepending each command with coverage -a?

3
  • What OS are you on? You could alias the command on Linux. Commented Mar 27, 2017 at 14:54
  • @PeterWood Linux, but something tells me that aliasing won't really work well - note that coverage run nosetests doesn't work. Commented Mar 27, 2017 at 15:06
  • "coverage run nosetests" doesn't work because "python nosetests" doesn't work. Commented Mar 27, 2017 at 20:13

1 Answer 1

1

See the coverage.py docs about subprocess measurement for a way to invoke coverage automatically when starting Python: http://coverage.readthedocs.io/en/latest/subprocess.html . It will require some fiddling.

It might be easier to alias in the shell script. For things like "nosetests", change it to "python -m nose".

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

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.