From 5a4f07629c10e165f02a8c495ff9a3928c24ad77 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sat, 5 Nov 2022 00:46:40 +0100 Subject: [PATCH] improve/clarify strange test code, fixes #6070 --- src/borg/testsuite/archiver/checks.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/borg/testsuite/archiver/checks.py b/src/borg/testsuite/archiver/checks.py index 3ea292cda..5d4a49ade 100644 --- a/src/borg/testsuite/archiver/checks.py +++ b/src/borg/testsuite/archiver/checks.py @@ -227,15 +227,11 @@ def test_unknown_feature_on_mount(self): @pytest.mark.allow_cache_wipe def test_unknown_mandatory_feature_in_cache(self): - if self.prefix: - path_prefix = "ssh://__testsuite__" - else: - path_prefix = "" - + remote_repo = bool(self.prefix) print(self.cmd(f"--repo={self.repository_location}", "rcreate", RK_ENCRYPTION)) with Repository(self.repository_path, exclusive=True) as repository: - if path_prefix: + if remote_repo: repository._location = Location(self.repository_location) manifest = Manifest.load(repository, Manifest.NO_OPERATION_CHECK) with Cache(repository, manifest) as cache: @@ -260,7 +256,7 @@ def wipe_wrapper(*args): assert called with Repository(self.repository_path, exclusive=True) as repository: - if path_prefix: + if remote_repo: repository._location = Location(self.repository_location) manifest = Manifest.load(repository, Manifest.NO_OPERATION_CHECK) with Cache(repository, manifest) as cache: