0

It seems to me that we need to clean up the .coverage hidden files created by nosetest or else nosetest would be confused when I try to run it a second time. It may return cached results in the .coverage file.

The reason I say that is I run nosetests --with-coverage --cover-package=.. It creates .coverage. Then I modify my unittests (e.g. remove an entire test), and I rerun nosetest. I expect the coverage to go down, but it doesn't. That seems wrong.

Next, I remove the .coverage hidden file. Rerun nosetest again, and I see that coverage did go down.

So, do I need to remove .coverage files?

Is there a standard procedure to clean up the .coverage files? Just call rm? Or is there a more correct way? Or is there a way to run nosetest so that it forces a retest instead of reading the .coverage files?

asked Mar 22, 2022 at 17:41
2
  • It sounds like you are jumping to a conclusion and asking about it rather than asking about the actual problem. How do you know nostest returned cached results rather than running the tests again and getting the same results? What are you actually seeing that you want to fix? We can better help you if you give these details rather than ask about your speculation of the cause. Commented Mar 22, 2022 at 17:47
  • nose has been deprecated / unmaintained for years. consider switching to pytest (and pytest-cov plugin) and your issue might just disappear. Commented Mar 22, 2022 at 18:08

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.