From 62db3f7abcec8cfdcd8526310f866d0fd08d8025 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Tue, 21 Jan 2020 19:27:57 +0100 Subject: [PATCH] typing: fix/adjust _code.source.getfslineno --- src/_pytest/_code/source.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/_code/source.py b/src/_pytest/_code/source.py index 67c74143f..379393b10 100644 --- a/src/_pytest/_code/source.py +++ b/src/_pytest/_code/source.py @@ -282,7 +282,7 @@ def compile_( # noqa: F811 return s.compile(filename, mode, flags, _genframe=_genframe) -def getfslineno(obj) -> Tuple[Union[str, py.path.local], int]: +def getfslineno(obj) -> Tuple[Optional[Union["Literal['']", py.path.local]], int]: """ Return source location (path, lineno) for the given object. If the source cannot be determined return ("", -1).