diff --git a/_pytest/python.py b/_pytest/python.py index 46d31755d..f9d2be63b 100644 --- a/_pytest/python.py +++ b/_pytest/python.py @@ -761,7 +761,7 @@ def _showfixtures_main(config, session): if verbose <= 0 and argname[0] == "_": continue if verbose > 0: - funcargspec = "%s -- %s" %(argname, loc,) + funcargspec = "%s -- %s" %(argname, bestrel,) else: funcargspec = argname tw.line(funcargspec, green=True) diff --git a/testing/test_python.py b/testing/test_python.py index 860b1db0f..9dc7d9f1c 100644 --- a/testing/test_python.py +++ b/testing/test_python.py @@ -1590,7 +1590,7 @@ class TestShowFixtures: def test_show_fixtures_verbose(self, testdir): result = testdir.runpytest("--fixtures", "-v") result.stdout.fnmatch_lines([ - "*tmpdir*", + "*tmpdir*--*tmpdir.py*", "*temporary directory*", ] )