From 5136fa8fe3ab974ba9a128ce7c3d7f729ee43e7c Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sat, 30 Sep 2023 23:52:02 +0200 Subject: [PATCH] fix test part that only works with LocalCache --- src/borg/testsuite/archiver/checks.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/borg/testsuite/archiver/checks.py b/src/borg/testsuite/archiver/checks.py index 51b3fe60e..1de88d4e1 100644 --- a/src/borg/testsuite/archiver/checks.py +++ b/src/borg/testsuite/archiver/checks.py @@ -277,6 +277,7 @@ def test_unknown_mandatory_feature_in_cache(archivers, request): repository._location = Location(archiver.repository_location) manifest = Manifest.load(repository, Manifest.NO_OPERATION_CHECK) with Cache(repository, manifest) as cache: + is_localcache = isinstance(cache, LocalCache) cache.begin_txn() cache.cache_config.mandatory_features = {"unknown-feature"} cache.commit() @@ -295,7 +296,8 @@ def test_unknown_mandatory_feature_in_cache(archivers, request): with patch.object(LocalCache, "wipe_cache", wipe_wrapper): cmd(archiver, "create", "test", "input") - assert called + if is_localcache: + assert called with Repository(archiver.repository_path, exclusive=True) as repository: if remote_repo: