For Jedi we want to generate our test coverage. There is a related question in stackoverflow, but it didn't help.
We're using py.test as a test runner. However, we are unable to add the imports and other "imported" stuff to the report. For example __init__.py
is always reported as being uncovered:
Name Stmts Miss Cover
--------------------------------------------------
jedi/__init__ 5 5 0%
[..]
Clearly this file is being imported and should therefore be reported as tested.
We start tests like this [*]:
py.test --cov jedi
As you can see we're using pytest-coverage
.
So how is it possible to properly count coverage of files like __init__.py
?
[*] We also tried starting test without --doctest-modules
(removed from pytest.ini
) and activate the coverage module earlier by py.test -p pytest_cov --cov jedi
. Neither of them work.
I've offered a bounty. Please try to fix it within Jedi. It's publicly available.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…