Ara
Ara

Reputation: 11

nosetests coverage report skipping some .py files and not sure why

I'm running a nosetests command that results in strange results. See image: for details: folder structure and coverage results

Why aren't the files under the customercard_source/objects folder being reported in the first nosetests run? If I manually add customercard_source to the list of packages then these files do get reported but then I end up with a duplication of the files under the resources folder as is also shown in the image. Thanks for the help!

Upvotes: 1

Views: 258

Answers (1)

Ned Batchelder
Ned Batchelder

Reputation: 375574

Coverage will include files that it believes can be imported. You need to have __init__.py files in folders for the contents of the folder to be importable. Make sure you have __init__.py files (they can be empty) in all the right places.

And BTW, if you don't have to use nose, don't. It's unmaintained. Pytest is a good option.

Upvotes: 1

Related Questions