Use TYPE_CHECKING instead of False
This allows for e.g. Jedi to infer types (it checks the name). It was only used to support Python 3.5.0/3.5.1, where this is is not available in the `typing` module. Ref: https://github.com/davidhalter/jedi/issues/1472 Uses `TYPE_CHECKING = False` in `_pytest.outcomes` to avoid having to work around circular import.
This commit is contained in:
@@ -23,9 +23,10 @@ from more_itertools.more import always_iterable
|
||||
import _pytest._code
|
||||
from _pytest.compat import overload
|
||||
from _pytest.compat import STRING_TYPES
|
||||
from _pytest.compat import TYPE_CHECKING
|
||||
from _pytest.outcomes import fail
|
||||
|
||||
if False: # TYPE_CHECKING
|
||||
if TYPE_CHECKING:
|
||||
from typing import Type # noqa: F401 (used in type string)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user