invirtualenv.contextmanager module¶
Useful contextmanagers
-
invirtualenv.contextmanager.
InTemporaryDirectory
(*args, **kwds)¶ A context manager that creates a temporary directory and changes the current directory into it.
-
invirtualenv.contextmanager.
TemporaryDirectory
(*args, **kwds)¶ A context manager that provides a temporary directory and cleans it up.
Note
This context manager duplicates the base functionality of the tempfile.TemporaryDirectory() context manager in Python 3.2+
Returns: The path to the temporary directory Return type: str
-
invirtualenv.contextmanager.
revert_file
(*args, **kwds)¶ A context manager that reverts a file’s contents.
-
invirtualenv.contextmanager.
working_dir
(*args, **kwds)¶ A context manager that changes to the new_path directory and returns to the current working directory when it completes.