Clean up warnings from newer flake8

Change-Id: I18a6327b3acdd4db5ae80097080c043f7c20c353
This commit is contained in:
Tim Burke 2019-06-25 15:25:53 -07:00
parent 113eacf3b8
commit 3b21157a84
5 changed files with 7 additions and 4 deletions

View File

@ -39,7 +39,7 @@ from swiftclient.utils import (
# Default is 100, increase to 256 # Default is 100, increase to 256
http_client._MAXHEADERS = 256 http_client._MAXHEADERS = 256
VERSIONFUL_AUTH_PATH = re.compile('v[2-3](?:\.0)?$') VERSIONFUL_AUTH_PATH = re.compile(r'v[2-3](?:\.0)?$')
AUTH_VERSIONS_V1 = ('1.0', '1', 1) AUTH_VERSIONS_V1 = ('1.0', '1', 1)
AUTH_VERSIONS_V2 = ('2.0', '2', 2) AUTH_VERSIONS_V2 = ('2.0', '2', 2)
AUTH_VERSIONS_V3 = ('3.0', '3', 3) AUTH_VERSIONS_V3 = ('3.0', '3', 3)

View File

@ -173,6 +173,7 @@ def _build_default_global_options():
'container_threads': 10 'container_threads': 10
} }
_default_global_options = _build_default_global_options() _default_global_options = _build_default_global_options()
_default_local_options = { _default_local_options = {

View File

@ -58,6 +58,7 @@ def immediate_exit(signum, frame):
stderr.write(" Aborted\n") stderr.write(" Aborted\n")
os_exit(2) os_exit(2)
st_delete_options = '''[--all] [--leave-segments] st_delete_options = '''[--all] [--leave-segments]
[--object-threads <threads>] [--object-threads <threads>]
[--container-threads <threads>] [--container-threads <threads>]

View File

@ -1822,7 +1822,7 @@ class TestShell(unittest.TestCase):
argv = ["", "tempurl", "GET", "60", '/v1/a/c', argv = ["", "tempurl", "GET", "60", '/v1/a/c',
"secret_key", "--absolute", '--prefix-based'] "secret_key", "--absolute", '--prefix-based']
with CaptureOutput(suppress_systemexit=True) as output: with CaptureOutput(suppress_systemexit=True) as output:
swiftclient.shell.main(argv) swiftclient.shell.main(argv)
self.assertEqual(expected, output.err, self.assertEqual(expected, output.err,
'Expected %r but got %r for path %r' % 'Expected %r but got %r for path %r' %
(expected, output.err, '/v1/a/c')) (expected, output.err, '/v1/a/c'))
@ -1832,7 +1832,7 @@ class TestShell(unittest.TestCase):
argv = ["", "tempurl", "GET", bad_time, '/v1/a/c/o', argv = ["", "tempurl", "GET", bad_time, '/v1/a/c/o',
"secret_key", "--absolute"] "secret_key", "--absolute"]
with CaptureOutput(suppress_systemexit=True) as output: with CaptureOutput(suppress_systemexit=True) as output:
swiftclient.shell.main(argv) swiftclient.shell.main(argv)
self.assertEqual(expected, output.err, self.assertEqual(expected, output.err,
'Expected %r but got %r for time %r' % 'Expected %r but got %r for time %r' %
(expected, output.err, bad_time)) (expected, output.err, bad_time))

View File

@ -79,7 +79,8 @@ commands=
# H403: multi line docstrings should end on a new line # H403: multi line docstrings should end on a new line
# H404: multi line docstring should start without a leading new line # H404: multi line docstring should start without a leading new line
# H405: multi line docstring summary not separated with an empty line # H405: multi line docstring summary not separated with an empty line
ignore = H101,H301,H306,H401,H403,H404,H405 # W504: line break after binary operator
ignore = H101,H301,H306,H401,H403,H404,H405,W504
# H106: Dont put vim configuration in source files # H106: Dont put vim configuration in source files
# H203: Use assertIs(Not)None to check for None # H203: Use assertIs(Not)None to check for None
enable-extensions=H106,H203 enable-extensions=H106,H203