diff options
author | Anthony Sottile <asottile@umich.edu> | 2020-10-05 18:13:05 -0700 |
---|---|---|
committer | Anthony Sottile <asottile@umich.edu> | 2020-10-05 18:33:17 -0700 |
commit | 33d119f71a60d1b41686c04a52c3a570fdcd506c (patch) | |
tree | 860431d60652d573998855f45b1ca868700032b1 /src/_pytest/debugging.py | |
parent | 703e89134c2b0c21225014e3a89c17ab062c0ab9 (diff) | |
download | pytest-33d119f71a60d1b41686c04a52c3a570fdcd506c.tar.gz |
py36+: com2ann
Diffstat (limited to 'src/_pytest/debugging.py')
-rw-r--r-- | src/_pytest/debugging.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/_pytest/debugging.py b/src/_pytest/debugging.py index 80004f468..d3a5c6173 100644 --- a/src/_pytest/debugging.py +++ b/src/_pytest/debugging.py @@ -94,13 +94,13 @@ def pytest_configure(config: Config) -> None: class pytestPDB: """Pseudo PDB that defers to the real pdb.""" - _pluginmanager = None # type: Optional[PytestPluginManager] - _config = None # type: Config - _saved = ( - [] - ) # type: List[Tuple[Callable[..., None], Optional[PytestPluginManager], Config]] + _pluginmanager: Optional[PytestPluginManager] = None + _config: Optional[Config] = None + _saved: List[ + Tuple[Callable[..., None], Optional[PytestPluginManager], Optional[Config]] + ] = [] _recursive_debug = 0 - _wrapped_pdb_cls = None # type: Optional[Tuple[Type[Any], Type[Any]]] + _wrapped_pdb_cls: Optional[Tuple[Type[Any], Type[Any]]] = None @classmethod def _is_capturing(cls, capman: Optional["CaptureManager"]) -> Union[str, bool]: @@ -166,6 +166,7 @@ class pytestPDB: def do_continue(self, arg): ret = super().do_continue(arg) if cls._recursive_debug == 0: + assert cls._config is not None tw = _pytest.config.create_terminal_writer(cls._config) tw.line() @@ -239,7 +240,7 @@ class pytestPDB: import _pytest.config if cls._pluginmanager is None: - capman = None # type: Optional[CaptureManager] + capman: Optional[CaptureManager] = None else: capman = cls._pluginmanager.getplugin("capturemanager") if capman: |