From 1a51f66f495e1b6046914202af53ccc95e24a230 Mon Sep 17 00:00:00 2001 From: Paul McCarthy <pauldmccarthy@gmail.com> Date: Tue, 27 Feb 2018 09:46:46 +0000 Subject: [PATCH] unit test for tempdir --- tests/test_tempdir.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_tempdir.py b/tests/test_tempdir.py index 742f3fc16..bd3f9a5c4 100644 --- a/tests/test_tempdir.py +++ b/tests/test_tempdir.py @@ -31,3 +31,12 @@ def test_tempdir(): assert op.realpath(os.getcwd()) == op.realpath(td) assert not op.exists(d) + + +def test_tempdir_root(): + + # this first tempdir is then used + # as the root for another temp dir + with tempdir.tempdir() as root: + with tempdir.tempdir(root=root) as td: + assert op.dirname(td) == root -- GitLab