diff --git a/changelog/7076.trivial.rst b/changelog/7076.bugfix.rst similarity index 100% rename from changelog/7076.trivial.rst rename to changelog/7076.bugfix.rst diff --git a/src/_pytest/skipping.py b/src/_pytest/skipping.py index 22e51bc4b..62a9ca491 100644 --- a/src/_pytest/skipping.py +++ b/src/_pytest/skipping.py @@ -168,9 +168,8 @@ def pytest_runtest_makereport(item, call): # to point to the item definition, otherwise it will display # the location of where the skip exception was raised within pytest _, _, reason = rep.longrepr - filename, line = item.location[:2] - filename = item.config.rootdir.join(filename) - rep.longrepr = filename, line + 1, reason + filename, line = item.reportinfo()[:2] + rep.longrepr = str(filename), line + 1, reason # called by terminalreporter progress reporting