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?
-
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.Code-Apprentice– Code-Apprentice2022年03月22日 17:47:46 +00:00Commented 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.wim– wim2022年03月22日 18:08:26 +00:00Commented Mar 22, 2022 at 18:08