diff options
author | Daniel Hahler <git@thequod.de> | 2020-01-28 18:39:47 +0100 |
---|---|---|
committer | Daniel Hahler <git@thequod.de> | 2020-01-28 18:53:28 +0100 |
commit | 1cf9e68dbce51f512f3ed9197a8cdc67a9171ded (patch) | |
tree | c086a2a33795aef0e7c4394391209efe3eaba1ef /testing | |
parent | 18ac7e0b79bcc99694ad095ff33746d6968c3b5e (diff) | |
download | pytest-1cf9e68dbce51f512f3ed9197a8cdc67a9171ded.tar.gz |
tests: cover absolute path handling in _compute_fixture_value
Diffstat (limited to 'testing')
-rw-r--r-- | testing/python/fixtures.py | 19 |
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( |