pytest-cov
pytest-cov copied to clipboard
annotate report for one line functions doesn't determine whether they ran or not.
Summary
When creating an annotate report, if the function is only one line, it'll get marked as '>', whether it's being run or not.
Expected vs actual result
for example, this function def func4(x): return x + 1 will be marked as > def func4(x): return x + 1 in annotate, even if it's not being run.
Expected result is > def func4(x): > return x + 1 or > def func4(x): ! return x + 1, depends on the case.
Reproducer
python -m pytest --cov-report annotate:out_dir --cov=. Tests
Versions
pytest-cov 2.11.1 Python 3.7.4 pytest version 5.1.2
Config
default configurations, no changes have been made.
Code
module code:
def func4(x): return x + 1
test code:
assert (func4(5) == 6)```