From 15d9c94981c1b90dd690f8cc336e6f2bd3b0f011 Mon Sep 17 00:00:00 2001 From: Milkey Mouse Date: Tue, 21 Nov 2017 11:41:36 -0800 Subject: [PATCH] Fix borg config flake8 failures Suppressed E731 so lambdas can be assigned to vars --- setup.cfg | 2 +- src/borg/testsuite/archiver.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/setup.cfg b/setup.cfg index 8e9414ac6..40ca52dba 100644 --- a/setup.cfg +++ b/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 diff --git a/src/borg/testsuite/archiver.py b/src/borg/testsuite/archiver.py index 56e1e3553..a773bd924 100644 --- a/src/borg/testsuite/archiver.py +++ b/src/borg/testsuite/archiver.py @@ -2783,13 +2783,13 @@ def test_config(self): 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.')