diff --git a/testing/test_skipping.py b/testing/test_skipping.py index 8b1cdd527..e7edf139d 100644 --- a/testing/test_skipping.py +++ b/testing/test_skipping.py @@ -1176,3 +1176,23 @@ def test_importorskip(): match="^could not import 'doesnotexist': No module named .*", ): pytest.importorskip("doesnotexist") + + +def test_relpath_rootdir(testdir): + testdir.makepyfile( + **{ + "tests/test_1.py": """ + import pytest + @pytest.mark.skip() + def test_pass(): + pass + """, + "tests/sub_tests/test_empty.py": """ + pass + """, + } + ) + result = testdir.runpytest("-rs", "tests/test_1.py", "--rootdir=tests/sub_tests") + result.stdout.fnmatch_lines( + ["SKIPPED [[]1[]] tests/test_1.py:2: unconditional skip"] + )