diff --git a/tests/test_tempdir.py b/tests/test_tempdir.py index bd3f9a5c4365e1c01f64728f4d535cb3bb0520b5..0495deb03ff2964162bd8620f506f447a2ab0913 100644 --- a/tests/test_tempdir.py +++ b/tests/test_tempdir.py @@ -40,3 +40,14 @@ def test_tempdir_root(): with tempdir.tempdir() as root: with tempdir.tempdir(root=root) as td: 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