From 3da19325f4402b43c0fa4ef00e937748720edda6 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Tue, 28 Jan 2020 16:36:04 +0100 Subject: [PATCH] Use nox.sessions.Session.chdir instead of os.chdir --- noxfile.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/noxfile.py b/noxfile.py index 39027fc8e..364e6e696 100644 --- a/noxfile.py +++ b/noxfile.py @@ -196,13 +196,11 @@ def workdir(nox_session, dir_path: pathlib.Path): """Temporarily chdir when entering CM and chdir back on exit.""" orig_dir = pathlib.Path.cwd() - nox_session.log(f"# Changing dir to {dir_path}") - os.chdir(dir_path) + nox_session.chdir(dir_path) try: yield dir_path finally: - nox_session.log(f"# Changing dir back to {orig_dir}") - os.chdir(orig_dir) + nox_session.chdir(orig_dir) @contextlib.contextmanager