Skip to content

Commit

Permalink
Ignoring cleanup issues in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AryazE committed Feb 21, 2024
1 parent 4099a15 commit 902332f
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions tests/run_single_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,18 @@ def test_runner(directory_pair: Tuple[str, str], capsys):
)

# restore uninstrumented program and remove temporary files
move(orig_program_file, program_file)
remove(join(abs_dir, "program-dynapyt.json"))
if cov:
remove(join(abs_dir, "covered.jsonl"))
remove(join(abs_dir, "covered.jsonl.lock"))
if exists(join(abs_dir, "__init__.py")) and exists(
join(abs_dir, "__init__.py.orig")
):
move(join(abs_dir, "__init__.py.orig"), join(abs_dir, "__init__.py"))
remove(join(abs_dir, "__init__-dynapyt.json"))
try:
move(orig_program_file, program_file)
remove(join(abs_dir, "program-dynapyt.json"))
if cov:
remove(join(abs_dir, "covered.jsonl"))
remove(join(abs_dir, "covered.jsonl.lock"))
if exists(join(abs_dir, "__init__.py")) and exists(
join(abs_dir, "__init__.py.orig")
):
move(join(abs_dir, "__init__.py.orig"), join(abs_dir, "__init__.py"))
remove(join(abs_dir, "__init__-dynapyt.json"))
except FileNotFoundError as fe:
print(f"File not found {fe} in {rel_dir}")
except Exception as e:
print(f"Something went wrong while cleaning up {rel_dir}: {e}")

0 comments on commit 902332f

Please sign in to comment.