Skip to content

Commit f1d6987

Browse files
committed
build: pragma tweaks
Some of these were really partial branches, not missed lines.
1 parent 1fc1107 commit f1d6987

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

metacov.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,13 @@ exclude_lines =
5454
pragma: not testing
5555

5656
# Lines that we can't run during metacov.
57-
pragma: no metacov
5857
pytest.mark.skipif\(env.METACOV
59-
if not env.METACOV:
6058

6159
# These lines only happen if tests fail.
6260
raise AssertionError
6361
pragma: only failure
6462

6563
# Not-real code for type checking
66-
if TYPE_CHECKING:
6764
class .*\(Protocol\):
6865
@overload
6966

@@ -85,7 +82,10 @@ partial_branches =
8582
# If we're asserting that any() is true, it didn't finish.
8683
assert any\(
8784
if env.TESTING:
85+
pragma: partial metacov
8886
if env.METACOV:
87+
if not env.METACOV:
88+
if TYPE_CHECKING:
8989

9090
precision = 3
9191

tests/test_oddball.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,15 @@ def recur(n):
145145
assert cov._collector is not None
146146
pytrace = (cov._collector.tracer_name() == "PyTracer") # fmt: skip
147147
expected_missing = [4]
148-
if pytrace: # pragma: no metacov
148+
if pytrace: # pragma: partial metacov
149149
expected_missing += [10, 11, 12]
150150

151151
_, statements, missing, _ = cov.analysis("recur.py")
152152
assert statements == [1, 2, 3, 4, 6, 8, 9, 10, 11, 12]
153153
assert expected_missing == missing
154154

155155
# Get a warning about the stackoverflow effect on the tracing function.
156-
if pytrace and not env.METACOV: # pragma: no metacov
156+
if pytrace and not env.METACOV: # pragma: partial metacov
157157
assert len(cov._warnings) == 1
158158
assert re.fullmatch(
159159
r"Trace function changed, data is likely wrong: None != "

0 commit comments

Comments
 (0)