Explicitly store CWD for restoring directory
@@ -36,11 +36,12 @@ def test_check_allowed_filepaths_pass(scroot, monkeypatch):
chip.load_target("freepdk45_demo")
# collect input files
+ cwd = os.getcwd()
workdir = chip._getworkdir(step='import', index='0')
os.makedirs(workdir)
os.chdir(workdir)
chip._collect('import', '0')
- os.chdir(chip.cwd)
+ os.chdir(cwd)
env = {
'SC_VALID_PATHS': os.path.join(scroot, 'third_party', 'pdks'),
@@ -62,10 +63,11 @@ def test_check_allowed_filepaths_fail(scroot, monkeypatch):
# collect input files
workdir = chip._getworkdir(step='import', index='0')
+ cwd = os.getcwd()
os.makedirs(workdir)
os.chdir(workdir)
chip._collect('import', '0')
- os.chdir(chip.cwd)
+ os.chdir(cwd)
env = {
'SC_VALID_PATHS': os.path.join(scroot, 'third_party', 'pdks'),
