Open erwagasore opened 8 years ago
this is a known issue wrt coverage not covering imported modules, there is a plan to fix this by loading the coverage plugin before the other plugins/conftest
Thanks @RonnyPfannschmidt. Is there any kind of work around?
Having the same issue. The weird thing is that using pytest.main() in a script by itself seems to fix the issue for me.
@RonnyPfannschmidt any progress so far with this issue? Just asking without the intention to be pressing. Thanks
no progress so far, personally i'm also working on other issues for quite a while longer
The workaround I've been having in my configs is -p pytest_cov
.
I am using pytest.main function call to create a flask test command
Once
pytest.main(options)
the coverage is32%
and it seems to ignore all method definition lines into all tested filesBut when I choose to use
os.system('py.test {}'.format(options))
the coverage become75%
which is the realistic coverage i was expecting