Used @contextmanager for create_temp_dir() too