Python code coverage

coverage 3.4 Nose 1.1.2 Python 2.7.1 

I have a python project structure as below

 root src #source directory company division pkg1 module1 module2 pkg2 module1 module2 test #All test files company division pkg1 test_module1 test_module2 

When I launch python nose, I use the following snippet

 #Run tests #Add dependencies like cheetah, yaml, etc to the sys.path if __name__ == "__main__": os.environ["NOSE_INCLUDE_EXE"] = "1" os.environ["NOSE_WITH_XUNIT"] = "1" os.environ["NOSE_WITH_COVERAGE"] = "1" os.environ["NOSE_COVER_PACKAGE"] = "company.division" nose.main() 

My assumption was that I get a clear and concise output of all packages under "company.division", however I get files from cheetah, barley and their scope, which are not interesting to me at all. Setting NOSE_COVER_PACKAGE does not seem to make any difference. Can someone tell me what I am missing?

+4
source share
1 answer

The OP reports that upgrading to nose 1.3 and coverage 3.6 corrects this.

See this hotfix for reference: https://github.com/Bahus/nose/commit/ddb14f0228ca94ae33d9e67785dc06bf412603f2

+1
source

All Articles