Relative path to invocationdir instead rootdir.

This commit is contained in:
Katarzyna 2020-05-03 22:56:38 +02:00
parent 80e5098408
commit 402ee6fb9d
2 changed files with 2 additions and 0 deletions

View File

@ -0,0 +1 @@
The path of file skipped by ``@pytest.mark.skip`` in the SKIPPED report is now relative to invocation directory. Previously it was relative to root directory.

View File

@ -169,6 +169,7 @@ def pytest_runtest_makereport(item, call):
# 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