diff --git a/tests/test_tempdir.py b/tests/test_tempdir.py index 0495deb03ff2964162bd8620f506f447a2ab0913..920997965cdc3c8e6cd1aee2caf2e0cd7fff94c7 100644 --- a/tests/test_tempdir.py +++ b/tests/test_tempdir.py @@ -51,3 +51,15 @@ def test_tempdir_changeto(): assert op.realpath(os.getcwd()) == cwd assert op.realpath(os.getcwd()) == cwd + + +def test_tempdir_override(): + with tempdir.tempdir() as parent: + + # tempdir should not create/change to + # a new temp directory, but should + # stay in the override directory + with tempdir.tempdir(override=parent): + assert op.realpath(os.getcwd()) == op.realpath(parent) + # override should not be deleted + assert op.exists(parent)