Skip to content

Commit 8e1d59a

Browse files
authored
Merge pull request #6579 from blueyed/pytester-makefile-joins-abspath
pytester: test for _makefile joining an absolute path
2 parents 7eaf98a + c2980eb commit 8e1d59a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

testing/test_pytester.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,3 +710,13 @@ def test_error2(bad_fixture):
710710
result.assert_outcomes(error=2)
711711

712712
assert result.parseoutcomes() == {"error": 2}
713+
714+
715+
def test_makefile_joins_absolute_path(testdir: Testdir) -> None:
716+
absfile = testdir.tmpdir / "absfile"
717+
if sys.platform == "win32":
718+
with pytest.raises(OSError):
719+
testdir.makepyfile(**{str(absfile): ""})
720+
else:
721+
p1 = testdir.makepyfile(**{str(absfile): ""})
722+
assert str(p1) == (testdir.tmpdir / absfile) + ".py"

0 commit comments

Comments
 (0)