diff options
author | Daniel Hahler <git@thequod.de> | 2020-01-29 00:58:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-29 00:58:43 +0100 |
commit | 8e1d59a8ddba34495bf3f2d0cd3d2f17e9dbc8af (patch) | |
tree | 7893b8a681cbad7f7d2e3fd2bbc35dd6248b6afc /testing | |
parent | 7eaf98af4bdac4f4cf61c590f1f7fd2eaa7e39c5 (diff) | |
parent | c2980eb80ffc9a7ab81d1424afeac77ec46a2fe2 (diff) | |
download | pytest-8e1d59a8ddba34495bf3f2d0cd3d2f17e9dbc8af.tar.gz |
Merge pull request #6579 from blueyed/pytester-makefile-joins-abspath
pytester: test for _makefile joining an absolute path
Diffstat (limited to 'testing')
-rw-r--r-- | testing/test_pytester.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/testing/test_pytester.py b/testing/test_pytester.py index 869e35db3..35a06e33a 100644 --- a/testing/test_pytester.py +++ b/testing/test_pytester.py @@ -710,3 +710,13 @@ def test_testdir_outcomes_with_multiple_errors(testdir): result.assert_outcomes(error=2) assert result.parseoutcomes() == {"error": 2} + + +def test_makefile_joins_absolute_path(testdir: Testdir) -> None: + absfile = testdir.tmpdir / "absfile" + if sys.platform == "win32": + with pytest.raises(OSError): + testdir.makepyfile(**{str(absfile): ""}) + else: + p1 = testdir.makepyfile(**{str(absfile): ""}) + assert str(p1) == (testdir.tmpdir / absfile) + ".py" |