summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2020-01-28 18:39:47 +0100
committerDaniel Hahler <git@thequod.de>2020-01-28 18:53:28 +0100
commit1cf9e68dbce51f512f3ed9197a8cdc67a9171ded (patch)
treec086a2a33795aef0e7c4394391209efe3eaba1ef /testing
parent18ac7e0b79bcc99694ad095ff33746d6968c3b5e (diff)
downloadpytest-1cf9e68dbce51f512f3ed9197a8cdc67a9171ded.tar.gz
tests: cover absolute path handling in _compute_fixture_value
Diffstat (limited to 'testing')
-rw-r--r--testing/python/fixtures.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/testing/python/fixtures.py b/testing/python/fixtures.py
index 8cfaae50d..d9ea5cf58 100644
--- a/testing/python/fixtures.py
+++ b/testing/python/fixtures.py
@@ -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(