From 16a44823eb053ded01136c7110760c8639c7343b Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Mon, 4 May 2020 19:09:29 -0300 Subject: [PATCH] Use reportinfo() instead of location in skipping message --- changelog/{7076.trivial.rst => 7076.bugfix.rst} | 0 src/_pytest/skipping.py | 5 ++--- 2 files changed, 2 insertions(+), 3 deletions(-) rename changelog/{7076.trivial.rst => 7076.bugfix.rst} (100%) 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