pytester: test for _makefile joining an absolute path
Ref: https://github.com/pytest-dev/pytest/pull/6578#discussion_r371035867
This commit is contained in:
parent
7c52a37d46
commit
c2980eb80f
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue