@contextlib.contextmanager<EOL><INDENT>def isolated_filesystem(self):<DEDENT>
cwd = os.getcwd()<EOL>t = tempfile.mkdtemp()<EOL>os.chdir(t)<EOL>try:<EOL><INDENT>yield t<EOL><DEDENT>finally:<EOL><INDENT>os.chdir(cwd)<EOL>try:<EOL><INDENT>shutil.rmtree(t)<EOL><DEDENT>except (OSError, IOError):<EOL><INDENT>pass<EOL><DEDENT><DEDENT>
A context manager that creates a temporary folder and changes
        the current working directory to it for isolated filesystem tests.