diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index d70b2c64a..5d54078de 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -547,9 +547,8 @@ class FixtureRequest: if has_params: frame = inspect.stack()[3] frameinfo = inspect.getframeinfo(frame[0]) - source_path = frameinfo.filename + source_path = py.path.local(frameinfo.filename) source_lineno = frameinfo.lineno - source_path = py.path.local(source_path) rel_source_path = source_path.relto(funcitem.config.rootdir) if rel_source_path: source_path_str = rel_source_path