diff --git a/testing/test_pytester.py b/testing/test_pytester.py index 869e35db3e1..35a06e33a32 100644 --- a/testing/test_pytester.py +++ b/testing/test_pytester.py @@ -710,3 +710,13 @@ def test_error2(bad_fixture): 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"