diff --git a/coverage/fullcoverage/encodings.py b/coverage/fullcoverage/encodings.py index b88418663..73bd5646e 100644 --- a/coverage/fullcoverage/encodings.py +++ b/coverage/fullcoverage/encodings.py @@ -14,6 +14,9 @@ a problem with coverage.py - that it starts too late to trace the coverage of many of the most fundamental modules in the Standard Library. +DO NOT import other modules into here, it will interfere with the goal of this +code executing before all imports. This is why this file isn't type-checked. + """ import sys diff --git a/pyproject.toml b/pyproject.toml index d2d2100f5..561ff9f77 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,3 +23,7 @@ warn_return_any = true warn_unreachable = true warn_unused_configs = true warn_unused_ignores = true + +exclude = """(?x)( + ^coverage/fullcoverage/encodings\\.py$ # can't import things into it. + )""" diff --git a/tox.ini b/tox.ini index ecece7ff5..5a5bfc90d 100644 --- a/tox.ini +++ b/tox.ini @@ -102,6 +102,7 @@ setenv = C5=coverage/parser.py coverage/phystokens.py coverage/plugin.py coverage/plugin_support.py coverage/python.py C6=coverage/report.py coverage/results.py coverage/sqldata.py coverage/summary.py C7=coverage/templite.py coverage/tomlconfig.py coverage/types.py coverage/version.py coverage/xmlreport.py + # not done yet: html.py pytracer.py TYPEABLE_C={env:C1} {env:C2} {env:C3} {env:C4} {env:C5} {env:C6} {env:C7} T1=tests/conftest.py tests/coveragetest.py tests/goldtest.py tests/helpers.py tests/mixins.py tests/osinfo.py T2=tests/test_annotate.py tests/test_api.py tests/test_arcs.py tests/test_cmdline.py tests/test_collector.py tests/test_concurrency.py