summaryrefslogtreecommitdiff
path: root/coverage/control.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2023-01-04 21:09:42 -0500
committerNed Batchelder <ned@nedbatchelder.com>2023-01-04 21:09:42 -0500
commit3a02703108831a554ec893b9031dcebe377fdd89 (patch)
treee2b579730daf750c05bfb2e0ee0596e0fa47079b /coverage/control.py
parent7b487470d0cccaf12d06cc363318c9b5eca6985f (diff)
downloadpython-coveragepy-git-3a02703108831a554ec893b9031dcebe377fdd89.tar.gz
mypy: test_debug.py test_execfile.py test_filereporter.py test_files.py
Diffstat (limited to 'coverage/control.py')
-rw-r--r--coverage/control.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/coverage/control.py b/coverage/control.py
index acd89b94..4e97ce9c 100644
--- a/coverage/control.py
+++ b/coverage/control.py
@@ -47,7 +47,8 @@ from coverage.report import render_report
from coverage.results import Analysis
from coverage.summary import SummaryReporter
from coverage.types import (
- TConfigurable, TConfigSection, TConfigValue, TFileDisposition, TLineNo, TMorf,
+ TConfigurable, TConfigSectionIn, TConfigValueIn, TConfigValueOut,
+ TFileDisposition, TLineNo, TMorf,
)
from coverage.xmlreport import XmlReporter
@@ -55,7 +56,7 @@ from coverage.xmlreport import XmlReporter
os = isolate_module(os)
@contextlib.contextmanager
-def override_config(cov: Coverage, **kwargs: TConfigValue) -> Generator[None, None, None]:
+def override_config(cov: Coverage, **kwargs: TConfigValueIn) -> Generator[None, None, None]:
"""Temporarily tweak the configuration of `cov`.
The arguments are applied to `cov.config` with the `from_args` method.
@@ -120,12 +121,12 @@ class Coverage(TConfigurable):
timid: Optional[bool]=None,
branch: Optional[bool]=None,
config_file: Union[str, bool]=True,
- source: Optional[List[str]]=None,
- source_pkgs: Optional[List[str]]=None,
- omit: Optional[Union[str, List[str]]]=None,
- include: Optional[Union[str, List[str]]]=None,
- debug: Optional[List[str]]=None,
- concurrency: Optional[Union[str, List[str]]]=None,
+ source: Optional[Iterable[str]]=None,
+ source_pkgs: Optional[Iterable[str]]=None,
+ omit: Optional[Union[str, Iterable[str]]]=None,
+ include: Optional[Union[str, Iterable[str]]]=None,
+ debug: Optional[Iterable[str]]=None,
+ concurrency: Optional[Union[str, Iterable[str]]]=None,
check_preimported: bool=False,
context: Optional[str]=None,
messages: bool=False,
@@ -425,7 +426,7 @@ class Coverage(TConfigurable):
if self._messages:
print(msg)
- def get_option(self, option_name: str) -> Optional[TConfigValue]:
+ def get_option(self, option_name: str) -> Optional[TConfigValueOut]:
"""Get an option from the configuration.
`option_name` is a colon-separated string indicating the section and
@@ -443,7 +444,7 @@ class Coverage(TConfigurable):
"""
return self.config.get_option(option_name)
- def set_option(self, option_name: str, value: Union[TConfigValue, TConfigSection]) -> None:
+ def set_option(self, option_name: str, value: Union[TConfigValueIn, TConfigSectionIn]) -> None:
"""Set an option in the configuration.
`option_name` is a colon-separated string indicating the section and