Browse Source

Fix borg config flake8 failures

Suppressed E731 so lambdas can be assigned to vars
Milkey Mouse 7 năm trước cách đây
mục cha
commit
15d9c94981
2 tập tin đã thay đổi với 7 bổ sung7 xóa
  1. 1 1
      setup.cfg
  2. 6 6
      src/borg/testsuite/archiver.py

+ 1 - 1
setup.cfg

@@ -5,7 +5,7 @@ python_files = testsuite/*.py
 # please note that the values are adjusted so that they do not cause failures
 # with existing code. if you want to change them, you should first fix all
 # flake8 failures that appear with your change.
-ignore = E122,E123,E125,E126,E127,E128,E226,E402,E722,E741,F401,F405,F811
+ignore = E122,E123,E125,E126,E127,E128,E226,E402,E722,E731,E741,F401,F405,F811
 # line length long term target: 120
 max-line-length = 255
 exclude = build,dist,.git,.idea,.cache,.tox,docs/conf.py

+ 6 - 6
src/borg/testsuite/archiver.py

@@ -2783,13 +2783,13 @@ id: 2 / e29442 3506da 4e1ea7 / 25f62a 5a3d41 - 02
         os.unlink('input/flagfile')
         self.cmd('init', '--encryption=repokey', self.repository_location)
         for flags in [[], ['--cache']]:
-            for key in {'testkey', 'testsection.testkey'}:
-                self.cmd('config', self.repository_location, *flags, key, exit_code=1)
-                self.cmd('config', self.repository_location, *flags, key, 'testcontents')
-                output = self.cmd('config', self.repository_location, *flags, key)
+            for cfg_key in {'testkey', 'testsection.testkey'}:
+                self.cmd('config', self.repository_location, *flags, cfg_key, exit_code=1)
+                self.cmd('config', self.repository_location, *flags, cfg_key, 'testcontents')
+                output = self.cmd('config', self.repository_location, *flags, cfg_key)
                 assert output == 'testcontents\n'
-                self.cmd('config', self.repository_location, *flags, '--delete', key)
-                self.cmd('config', self.repository_location, *flags, key, exit_code=1)
+                self.cmd('config', self.repository_location, *flags, '--delete', cfg_key)
+                self.cmd('config', self.repository_location, *flags, cfg_key, exit_code=1)
 
     requires_gnutar = pytest.mark.skipif(not have_gnutar(), reason='GNU tar must be installed for this test.')
     requires_gzip = pytest.mark.skipif(not shutil.which('gzip'), reason='gzip must be installed for this test.')