Skip to content

Commit a9098be

Browse files
committed
Add test for tempfile.mkdtemp output being absolute
1 parent ef2dda6 commit a9098be

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Lib/test/test_tempfile.py

+6
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,12 @@ def test_for_tempdir_is_bytes_issue40701_api_warts(self):
848848
finally:
849849
tempfile.tempdir = orig_tempdir
850850

851+
def test_absolute_path(self):
852+
"""Test that the path returned is absolute"""
853+
path = tempfile.mkdtemp(dir=".")
854+
self.assertEqual(os.path.isabs(path), True)
855+
os.rmdir(path)
856+
851857

852858
class TestMktemp(BaseTestCase):
853859
"""Test mktemp()."""

0 commit comments

Comments
 (0)