RaduG / pytest_func_cov

MIT License
7 stars 2 forks source link

No coverage report #12

Open innateessence opened 3 years ago

innateessence commented 3 years ago

I'm trying to test a flask app, and I'm not getting any coverage reporting information when using this plugin

$ pytest -W ignore::DeprecationWarning --func_cov=my_project tests/

============================ test session starts ============================
platform linux -- Python 3.9.5, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /home/jack/code/python/my_project
plugins: func-cov-0.2.3, forked-1.3.0, xdist-2.3.0, Faker-8.7.0, cov-2.12.1, flask-1.2.0
collected 36 items

tests/models/test_1py .                                         [  2%]
tests/models/test_2.py ...............                           [ 44%]
tests/routes/test_3.py .........                            [ 69%]
tests/routes/test_4.py ........                                   [ 91%]
tests/routes/test_5.py ...                                      [100%]
--------------------pytest_func_cov--------------------
Name    Funcs   Miss     Cover
------------------------------
------------------------------
TOTAL       0      0        0%

============================ 36 passed in 7.32s ============================
stefaneidelloth commented 2 years ago

Same issue for me. I tried with

foo/foo.py

def foo():
    return True

and

tests/test_foo.py

from foo import foo

def test_foo():
    assert foo() is True

and command

pytest --func_cov=foo --func_cov_report=term-missing tests

and could reproduce the issue:

image

=> Coverage for function 'foo' should be 100 %

=> Did anyone successfully use pytest_func_cov?