summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2020-01-29 00:58:43 +0100
committerGitHub <noreply@github.com>2020-01-29 00:58:43 +0100
commit8e1d59a8ddba34495bf3f2d0cd3d2f17e9dbc8af (patch)
tree7893b8a681cbad7f7d2e3fd2bbc35dd6248b6afc /testing
parent7eaf98af4bdac4f4cf61c590f1f7fd2eaa7e39c5 (diff)
parentc2980eb80ffc9a7ab81d1424afeac77ec46a2fe2 (diff)
downloadpytest-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.py10
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"