From fa7be0a8df9d99d4dd880afb4f48a9b197dca5b0 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Mon, 24 Aug 2026 13:36:43 +0200 Subject: [PATCH] test: refactor: Remove confusing ignore_errors=True --- test/functional/test_framework/test_framework.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py index 70aeb426662..87317c3eeff 100755 --- a/test/functional/test_framework/test_framework.py +++ b/test/functional/test_framework/test_framework.py @@ -961,14 +961,13 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass): self.stop_nodes() self.nodes = [] - def cache_path(*paths): - return os.path.join(cache_node_dir, self.chain, *paths) + cache_path = cache_node_dir / self.chain - os.rmdir(cache_path('wallets')) # Remove empty wallets dir - shutil.rmtree(cache_path('fees'), ignore_errors=True) - for entry in os.listdir(cache_path()): - if entry not in ['chainstate', 'blocks', 'indexes']: # Only indexes, chainstate and blocks folders - os.remove(cache_path(entry)) + (cache_path / "wallets").rmdir() # Do not cache empty wallets dir + shutil.rmtree(cache_path / "fees") # Do not cache fees dat files + for entry in cache_path.iterdir(): + if entry.name not in ["chainstate", "blocks", "indexes"]: # Only keep indexes, chainstate and blocks folders + entry.unlink() for i in range(self.num_nodes): self.log.debug("Copy cache directory {} to node {}".format(cache_node_dir, i))