summaryrefslogtreecommitdiff
path: root/coverage/plugin.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2023-01-01 18:57:42 -0500
committerNed Batchelder <ned@nedbatchelder.com>2023-01-01 19:27:47 -0500
commit0c9b5e0e9da9c2cffd50db7b28142d22d0f66cee (patch)
treee407697322a76e40ccc38ac44aa4d2f2489d6dcc /coverage/plugin.py
parent8f4d404c8f9044ea1c3bf2479236f51d7706cb76 (diff)
downloadpython-coveragepy-git-0c9b5e0e9da9c2cffd50db7b28142d22d0f66cee.tar.gz
mypy: check collector.py and plugin_support.py
Diffstat (limited to 'coverage/plugin.py')
-rw-r--r--coverage/plugin.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/coverage/plugin.py b/coverage/plugin.py
index 4a7fc235..ccc33337 100644
--- a/coverage/plugin.py
+++ b/coverage/plugin.py
@@ -127,6 +127,9 @@ from coverage.types import TArc, TConfigurable, TLineNo, TSourceTokenLines
class CoveragePlugin:
"""Base class for coverage.py plug-ins."""
+ _coverage_plugin_name: str
+ _coverage_enabled: bool
+
def file_tracer(self, filename: str) -> Optional[FileTracer]: # pylint: disable=unused-argument
"""Get a :class:`FileTracer` object for a file.
@@ -249,7 +252,12 @@ class CoveragePlugin:
return []
-class FileTracer:
+class CoveragePluginBase:
+ """Plugins produce specialized objects, which point back to the original plugin."""
+ _coverage_plugin: CoveragePlugin
+
+
+class FileTracer(CoveragePluginBase):
"""Support needed for files during the execution phase.
File tracer plug-ins implement subclasses of FileTracer to return from
@@ -337,7 +345,7 @@ class FileTracer:
@functools.total_ordering
-class FileReporter:
+class FileReporter(CoveragePluginBase):
"""Support needed for files during the analysis and reporting phases.
File tracer plug-ins implement a subclass of `FileReporter`, and return