Use TYPE_CHECKING (#6771)

This commit is contained in:
Daniel Hahler 2020-02-19 22:07:54 +01:00 committed by GitHub
parent 1b30514783
commit 2b13a9b95d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -795,7 +795,7 @@ class Config:
kwargs=dict(parser=self._parser, pluginmanager=self.pluginmanager)
)
if False: # TYPE_CHECKING
if TYPE_CHECKING:
from _pytest.cacheprovider import Cache
self.cache = None # type: Optional[Cache]

View File

@ -13,10 +13,11 @@ import pytest
from _pytest import outcomes
from _pytest import reports
from _pytest import runner
from _pytest.compat import TYPE_CHECKING
from _pytest.config import ExitCode
from _pytest.outcomes import OutcomeException
if False: # TYPE_CHECKING
if TYPE_CHECKING:
from typing import Type