Skip to content
Snippets Groups Projects
Commit c355eaa4 authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

new unit test for tempdir

parent 4fce9451
No related branches found
No related tags found
No related merge requests found
...@@ -40,3 +40,14 @@ def test_tempdir_root(): ...@@ -40,3 +40,14 @@ def test_tempdir_root():
with tempdir.tempdir() as root: with tempdir.tempdir() as root:
with tempdir.tempdir(root=root) as td: with tempdir.tempdir(root=root) as td:
assert op.dirname(td) == root assert op.dirname(td) == root
def test_tempdir_changeto():
cwd = op.realpath(os.getcwd())
# make sure cwd is not changed
with tempdir.tempdir(changeto=False):
assert op.realpath(os.getcwd()) == cwd
assert op.realpath(os.getcwd()) == cwd
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment