Browse Source

fix RepositoryTestCaseBase.reopen method

"if self.repository" did not work as expected:
- Repository has a __len__ method, so the boolean evaluation was calling that.
- self.repository is also not set to None anywhere.
Thomas Waldmann 2 years ago
parent
commit
3d82be0b58
1 changed files with 1 additions and 2 deletions
  1. 1 2
      src/borg/testsuite/repository.py

+ 1 - 2
src/borg/testsuite/repository.py

@@ -65,8 +65,7 @@ class RepositoryTestCaseBase(BaseTestCase):
         shutil.rmtree(self.tmppath)
 
     def reopen(self, exclusive=UNSPECIFIED):
-        if self.repository:
-            self.repository.close()
+        self.repository.close()
         self.repository = self.open(exclusive=exclusive)
 
     def add_keys(self):