From: Oleg Broytman Date: Sun, 18 Sep 2022 14:47:04 +0000 (+0300) Subject: CI(GHActions): Teardown harder X-Git-Url: https://git.phdru.name/?p=ppu.git;a=commitdiff_plain;h=2454320bc766d48f450dc888cb78eb4a8197483f CI(GHActions): Teardown harder --- diff --git a/tests/ppu_tu.py b/tests/ppu_tu.py index 1ce2b64..94de246 100644 --- a/tests/ppu_tu.py +++ b/tests/ppu_tu.py @@ -15,7 +15,7 @@ def setup(): def teardown(): os.chdir(os.sep) # To the root of the FS - shutil.rmtree(tmp_dir) + shutil.rmtree(tmp_dir, ignore_errors=True) def find_in_path(name): diff --git a/tests/test_remove_old_files.py b/tests/test_remove_old_files.py index dce091d..645362a 100755 --- a/tests/test_remove_old_files.py +++ b/tests/test_remove_old_files.py @@ -37,6 +37,11 @@ def test_recursive(): def test_remove_empty_directory(): + teardown() + try: + setup() + except OSError: + pass create_files(['test3', 'test4'], 'subdir') test3 = os.path.join('subdir', 'test3') test4 = os.path.join('subdir', 'test4')