summaryrefslogtreecommitdiff
path: root/coverage/env.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2022-12-31 22:08:25 -0500
committerNed Batchelder <ned@nedbatchelder.com>2022-12-31 22:08:25 -0500
commit09f9188e826f900198d638ee3c42b27bca29597d (patch)
tree785dca94af0f4ac52bd8bb21d02cd80e2c6c87e5 /coverage/env.py
parent0bf14e2d297599bb0b0454b1b2636171aefb1882 (diff)
downloadpython-coveragepy-git-09f9188e826f900198d638ee3c42b27bca29597d.tar.gz
mypy: add env.py
Diffstat (limited to 'coverage/env.py')
-rw-r--r--coverage/env.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/coverage/env.py b/coverage/env.py
index fcd5ff04..0b01f3e7 100644
--- a/coverage/env.py
+++ b/coverage/env.py
@@ -7,6 +7,8 @@ import os
import platform
import sys
+from typing import Any, Iterable, Tuple
+
# Operating systems.
WINDOWS = sys.platform == "win32"
LINUX = sys.platform.startswith("linux")
@@ -21,7 +23,7 @@ PYPY = (platform.python_implementation() == "PyPy")
PYVERSION = sys.version_info + (int(platform.python_version()[-1] == "+"),)
if PYPY:
- PYPYVERSION = sys.pypy_version_info
+ PYPYVERSION = sys.pypy_version_info # type: ignore[attr-defined]
# Python behavior.
class PYBEHAVIOR:
@@ -134,13 +136,14 @@ METACOV = os.getenv('COVERAGE_COVERAGE', '') != ''
TESTING = os.getenv('COVERAGE_TESTING', '') == 'True'
-def debug_info():
+def debug_info() -> Iterable[Tuple[str, Any]]:
"""Return a list of (name, value) pairs for printing debug information."""
info = [
(name, value) for name, value in globals().items()
if not name.startswith("_") and
name not in {"PYBEHAVIOR", "debug_info"} and
- not isinstance(value, type(os))
+ not isinstance(value, type(os)) and
+ not str(value).startswith("typing.")
]
info += [
(name, value) for name, value in PYBEHAVIOR.__dict__.items()