summaryrefslogtreecommitdiff
path: root/coverage/collector.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2021-10-14 21:35:34 -0400
committerNed Batchelder <ned@nedbatchelder.com>2021-10-14 21:35:34 -0400
commite4c3d3007bce562f1fbdc2d2029a4bcbeaf8cd08 (patch)
treec19e8c6cbb70b72965161a9dc649a7785db0e586 /coverage/collector.py
parent4a5cf280fe8622a4ccd03c07cdd6adf3207df20f (diff)
downloadpython-coveragepy-git-e4c3d3007bce562f1fbdc2d2029a4bcbeaf8cd08.tar.gz
test: mark some uncovered lines in collector.py
Diffstat (limited to 'coverage/collector.py')
-rw-r--r--coverage/collector.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/coverage/collector.py b/coverage/collector.py
index a72129e2..6f9aa2c1 100644
--- a/coverage/collector.py
+++ b/coverage/collector.py
@@ -21,7 +21,7 @@ try:
from coverage.tracer import CTracer, CFileDisposition
except ImportError:
# Couldn't import the C extension, maybe it isn't built.
- if os.getenv('COVERAGE_TEST_TRACER') == 'c':
+ if os.getenv('COVERAGE_TEST_TRACER') == 'c': # pragma: part covered
# During testing, we use the COVERAGE_TEST_TRACER environment variable
# to indicate that we've fiddled with the environment to test this
# fallback code. If we thought we had a C tracer, but couldn't import
@@ -411,15 +411,15 @@ class Collector:
# in other threads. We try three times in case of concurrent
# access, hoping to get a clean copy.
runtime_err = None
- for _ in range(3):
+ for _ in range(3): # pragma: part covered
try:
items = list(d.items())
- except RuntimeError as ex:
+ except RuntimeError as ex: # pragma: cant happen
runtime_err = ex
else:
break
else:
- raise runtime_err
+ raise runtime_err # pragma: cant happen
return {self.cached_mapped_file(k): v for k, v in items if v}