简体   繁体   中英

Restrict nosetests coverage to only the tests that were run

Is there a way to have nosetests restrict the coverage information to only the tests that were run?

I know about the cover-package flag, but it would be nicer if you didn't have to specify the package.

This would be especially useful when running aa single unit test class that lives in a file with multiple unit test classes.

Unfortunately I do not know of a way in nosetests to perform this action. I actually ended up uninstalling nosetests and using just coverage.py because it seems like nosetests and coverage don't play nicely together. I know for a fact you can specify down to individual test methods what you want to run. I'm not sure if that's exactly what you are looking for but I beat my head against a brick wall for days trying to get nosetests to cooperate with no luck. Maybe it would save some effort to switch and run coverage.py directly instead?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM