Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Does not report coverage for sub packages #256

Closed
drcrook1 opened this issue Jan 7, 2019 · 1 comment
Closed

Does not report coverage for sub packages #256

drcrook1 opened this issue Jan 7, 2019 · 1 comment

Comments

@drcrook1
Copy link

drcrook1 commented Jan 7, 2019

Hey Folks,

I'm not sure it is related to this: #117 ; I don't believe it is, but it could be.

I have a test structure like this:
app
init.py
RootModule1
RootModule2

  • FolderA
    • init.py
    • ModuleA1
    • ModuleA2
  • Folder B
    • init.py
    • ModuleB1
    • ModuleB2

tests
test_RootModule1
test_RootModule2

  • test_FolderA
    • test_ModuleA1
    • test_ModuleA2
  • test_Folder B
    • test_ModuleB1
    • test_ModuleB2

pytest appears to effectively find all of my tests and run them. The problem is with coverage. My coverage report looks as follows:

app
init.py 100%
RootModule1 100%
RootModule2 100%

  • FolderA
    • init.py 100%
    • ModuleA1 0%
    • ModuleA2 0%
  • Folder B
    • init.py 100%
    • ModuleB1 0%
    • ModuleB2 0%

The init files are all empty (no code). Based on my own counting of lines running the various sub packages should be covered by ~50-75% for each one I have but they are reporting at 0%.

My test command is as such:

pytest --doctest-modules --junitxml=/tests/junit/test-results.xml --cov=app /tests --cov-report=xml:/tests/junit/coverage.xml --cov-report=html:/tests/junit/cov_html

Any assistance is greatly appreciated; I'm working on documenting how to set all this up inside containers as part of automated build processes for python projects.

@drcrook1
Copy link
Author

drcrook1 commented Jan 7, 2019

I misspelled something; go figure. It all works. Closing this issue.

@drcrook1 drcrook1 closed this as completed Jan 7, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant