Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

[Question] Function cov mark function headers as missing #146

Open
ghooo opened this issue Oct 16, 2015 · 1 comment
Open

[Question] Function cov mark function headers as missing #146

ghooo opened this issue Oct 16, 2015 · 1 comment

Comments

@ghooo
Copy link

ghooo commented Oct 16, 2015

Adding cov as a command that does test coverage, usually shows function/class headers as missing. This actually make sense because, in manage.py we import the app first then define our manager. After that we define cov. When cov is called all the prototypes of functions/classes are already loaded so coverage does not cover them and assumes they are missing.

The only way I managed to solve this is to not use the manager at all, and just add a new separate file cov.py that does the test coverage:

import coverage

cov = coverage.Coverage()
cov.start()

# .. call your tests ..

cov.stop()
cov.save()

cov.html_report()

How to use the manager with coverage?

@misakar
Copy link

misakar commented Oct 21, 2015

I think, maybe you can use create_app function in manage.py and create app after define cov.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants