From 2454320bc766d48f450dc888cb78eb4a8197483f Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sun, 18 Sep 2022 17:47:04 +0300 Subject: [PATCH] CI(GHActions): Teardown harder --- tests/ppu_tu.py | 2 +- tests/test_remove_old_files.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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') -- 2.39.5