Test relapth when rootdir != invocationdir.
This commit is contained in:
parent
402ee6fb9d
commit
a5bcd0655f
|
@ -1176,3 +1176,23 @@ def test_importorskip():
|
||||||
match="^could not import 'doesnotexist': No module named .*",
|
match="^could not import 'doesnotexist': No module named .*",
|
||||||
):
|
):
|
||||||
pytest.importorskip("doesnotexist")
|
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"]
|
||||||
|
)
|
||||||
|
|
Loading…
Reference in New Issue