tests: cover absolute path handling in _compute_fixture_value

This commit is contained in:
Daniel Hahler
2020-01-28 18:39:47 +01:00
parent 18ac7e0b79
commit 1cf9e68dbc
2 changed files with 21 additions and 3 deletions

View File

@@ -3662,13 +3662,30 @@ class TestParameterizedSubRequest:
" test_foos.py::test_foo",
"",
"Requested fixture 'fix_with_param' defined in:",
"*fix.py:4",
"{}:4".format(fixfile),
"Requested here:",
"test_foos.py:4",
"*1 failed*",
]
)
# With non-overlapping rootdir, passing tests_dir.
rootdir = testdir.mkdir("rootdir")
rootdir.chdir()
result = testdir.runpytest("--rootdir", rootdir, tests_dir)
result.stdout.fnmatch_lines(
[
"The requested fixture has no parameter defined for test:",
" test_foos.py::test_foo",
"",
"Requested fixture 'fix_with_param' defined in:",
"{}:4".format(fixfile),
"Requested here:",
"{}:4".format(testfile),
"*1 failed*",
]
)
def test_pytest_fixture_setup_and_post_finalizer_hook(testdir):
testdir.makeconftest(