A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/nedbat/coveragepy/issues/1908 below:

3.14 field annotation not covered · Issue #1908 · nedbat/coveragepy · GitHub

The following snippet gets counted as 100% coverage under 3.13 and earlier versions, but under 3.14 it is counted as having a missing line:

class X:
    x: int  # <-- not covered under 3.14
python3.14 -m coverage run asdf.py && python3.14 -m coverage combine --quiet && python3.14 -m coverage report --fail-under 100
Name      Stmts   Miss Branch BrPart  Cover
-------------------------------------------
asdf.py       2      1      0      0    50%
-------------------------------------------
TOTAL         2      1      0      0    50%
Coverage failure: total of 50 is less than fail-under=100

Adding from __future__ import annotations causes everything to be counted:

from __future__ import annotations

class X:
    x: int  # <-- covered

Could have something to do with https://docs.python.org/3.14/whatsnew/3.14.html#whatsnew314-pep649?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4