Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jkbrzt committed Jun 14, 2024
1 parent 121cba1 commit 5dedead
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ def dump_stderr():


@contextlib.contextmanager
def cd_clean_tmp_dir(assert_filenames_after=[]):
def cd_clean_tmp_dir(assert_filenames_after=None):
"""Run commands inside a clean temporary directory, and verify created file names."""
orig_cwd = os.getcwd()
with tempfile.TemporaryDirectory() as tmp_dirname:
Expand All @@ -483,6 +483,7 @@ def cd_clean_tmp_dir(assert_filenames_after=[]):
try:
yield tmp_dirname
actual_filenames = os.listdir('.')
assert actual_filenames == assert_filenames_after, (actual_filenames, assert_filenames_after)
if assert_filenames_after is not None:
assert actual_filenames == assert_filenames_after, (actual_filenames, assert_filenames_after)
finally:
os.chdir(orig_cwd)

0 comments on commit 5dedead

Please sign in to comment.