From 7ee27fedeee19e48757ab11015bd3972c59d838c Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Tue, 21 Jan 2020 19:24:30 +0100 Subject: [PATCH] doc: fix Code.path: might return str --- src/_pytest/_code/code.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/_pytest/_code/code.py b/src/_pytest/_code/code.py index 55c9e9100..3620970fd 100644 --- a/src/_pytest/_code/code.py +++ b/src/_pytest/_code/code.py @@ -68,8 +68,9 @@ class Code: @property def path(self) -> Union[py.path.local, str]: - """ return a path object pointing to source code (note that it - might not point to an actually existing file). """ + """ return a path object pointing to source code (or a str in case + of OSError / non-existing file). + """ try: p = py.path.local(self.raw.co_filename) # maybe don't try this checking