Use asottile/add-trailing-comma
diff --git a/tests/check_docstring_first_test.py b/tests/check_docstring_first_test.py
index f14880b..aa9898d 100644
--- a/tests/check_docstring_first_test.py
+++ b/tests/check_docstring_first_test.py
@@ -19,7 +19,7 @@
'"foo"\n',
1,
'{filename}:2 Module docstring appears after code '
- '(code seen on line 1).\n'
+ '(code seen on line 1).\n',
),
# Test double docstring
(
@@ -28,7 +28,7 @@
'"fake docstring"\n',
1,
'{filename}:3 Multiple module docstrings '
- '(first docstring on line 1).\n'
+ '(first docstring on line 1).\n',
),
# Test multiple lines of code above
(
diff --git a/tests/check_merge_conflict_test.py b/tests/check_merge_conflict_test.py
index 5a2e82a..a999aca 100644
--- a/tests/check_merge_conflict_test.py
+++ b/tests/check_merge_conflict_test.py
@@ -45,7 +45,7 @@
'child\n'
'=======\n'
'parent\n'
- '>>>>>>>'
+ '>>>>>>>',
) or f1.startswith(
'<<<<<<< HEAD\n'
'child\n'
@@ -53,7 +53,7 @@
'||||||| merged common ancestors\n'
'=======\n'
'parent\n'
- '>>>>>>>'
+ '>>>>>>>',
) or f1.startswith(
# .gitconfig with [pull] rebase = preserve causes a rebase which
# flips parent / child
@@ -61,7 +61,7 @@
'parent\n'
'=======\n'
'child\n'
- '>>>>>>>'
+ '>>>>>>>',
)
assert os.path.exists(os.path.join('.git', 'MERGE_MSG'))
yield
diff --git a/tests/debug_statement_hook_test.py b/tests/debug_statement_hook_test.py
index c318346..7891eac 100644
--- a/tests/debug_statement_hook_test.py
+++ b/tests/debug_statement_hook_test.py
@@ -46,7 +46,7 @@
visitor = ImportStatementParser()
visitor.visit(ast_with_debug_import_form_1)
assert visitor.debug_import_statements == [
- DebugStatement('ipdb', 3, 0)
+ DebugStatement('ipdb', 3, 0),
]
@@ -54,7 +54,7 @@
visitor = ImportStatementParser()
visitor.visit(ast_with_debug_import_form_2)
assert visitor.debug_import_statements == [
- DebugStatement('pudb', 3, 0)
+ DebugStatement('pudb', 3, 0),
]
diff --git a/tests/detect_aws_credentials_test.py b/tests/detect_aws_credentials_test.py
index 943a3f8..beb382f 100644
--- a/tests/detect_aws_credentials_test.py
+++ b/tests/detect_aws_credentials_test.py
@@ -21,14 +21,14 @@
(
{
'AWS_DUMMY_KEY': '/foo', 'AWS_CONFIG_FILE': '/bar',
- 'AWS_CREDENTIAL_FILE': '/baz'
+ 'AWS_CREDENTIAL_FILE': '/baz',
},
{'/bar', '/baz'}
),
(
{
'AWS_CONFIG_FILE': '/foo', 'AWS_CREDENTIAL_FILE': '/bar',
- 'AWS_SHARED_CREDENTIALS_FILE': '/baz'
+ 'AWS_SHARED_CREDENTIALS_FILE': '/baz',
},
{'/foo', '/bar', '/baz'}
),
@@ -51,7 +51,7 @@
({'AWS_DUMMY_KEY': 'foo', 'AWS_SECRET_ACCESS_KEY': 'bar'}, {'bar'}),
(
{'AWS_SECRET_ACCESS_KEY': 'foo', 'AWS_SECURITY_TOKEN': 'bar'},
- {'foo', 'bar'}
+ {'foo', 'bar'},
),
),
)
@@ -66,7 +66,7 @@
(
(
'aws_config_with_secret.ini',
- {'z2rpgs5uit782eapz5l1z0y2lurtsyyk6hcfozlb'}
+ {'z2rpgs5uit782eapz5l1z0y2lurtsyyk6hcfozlb'},
),
('aws_config_with_session_token.ini', {'foo'}),
('aws_config_with_secret_and_session_token.ini',
@@ -77,8 +77,8 @@
'7xebzorgm5143ouge9gvepxb2z70bsb2rtrh099e',
'z2rpgs5uit782eapz5l1z0y2lurtsyyk6hcfozlb',
'ixswosj8gz3wuik405jl9k3vdajsnxfhnpui38ez',
- 'foo'
- }
+ 'foo',
+ },
),
('aws_config_without_secrets.ini', set()),
('nonsense.txt', set()),
@@ -121,7 +121,7 @@
mock_secrets_file.return_value = set()
ret = main((
get_resource_path('aws_config_without_secrets.ini'),
- "--credentials-file=testing/resources/credentailsfilethatdoesntexist"
+ "--credentials-file=testing/resources/credentailsfilethatdoesntexist",
))
assert ret == 2
out, _ = capsys.readouterr()
@@ -141,6 +141,6 @@
ret = main((
get_resource_path('aws_config_without_secrets.ini'),
"--credentials-file=testing/resources/credentailsfilethatdoesntexist",
- "--allow-missing-credentials"
+ "--allow-missing-credentials",
))
assert ret == 0
diff --git a/tests/file_contents_sorter_test.py b/tests/file_contents_sorter_test.py
index 2c85c8a..1f9a14b 100644
--- a/tests/file_contents_sorter_test.py
+++ b/tests/file_contents_sorter_test.py
@@ -21,7 +21,7 @@
(b'@\n-\n_\n#\n', FAIL, b'#\n-\n@\n_\n'),
(b'extra\n\n\nwhitespace\n', FAIL, b'extra\nwhitespace\n'),
(b'whitespace\n\n\nextra\n', FAIL, b'extra\nwhitespace\n'),
- )
+ ),
)
def test_integration(input_s, expected_retval, output, tmpdir):
path = tmpdir.join('file.txt')
diff --git a/tests/fix_encoding_pragma_test.py b/tests/fix_encoding_pragma_test.py
index d49f1ba..7288bfa 100644
--- a/tests/fix_encoding_pragma_test.py
+++ b/tests/fix_encoding_pragma_test.py
@@ -56,7 +56,7 @@
b'# -*- coding: utf-8 -*-\n'
b'foo = "bar"\n'
),
- )
+ ),
)
def test_ok_inputs(input_str):
bytesio = io.BytesIO(input_str)
@@ -100,7 +100,7 @@
(b'#!/usr/bin/env python\n', b''),
(b'#!/usr/bin/env python\n#coding: utf8\n', b''),
(b'#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n', b''),
- )
+ ),
)
def test_not_ok_inputs(input_str, output):
bytesio = io.BytesIO(input_str)
diff --git a/tests/requirements_txt_fixer_test.py b/tests/requirements_txt_fixer_test.py
index 3681cc6..dcf7a76 100644
--- a/tests/requirements_txt_fixer_test.py
+++ b/tests/requirements_txt_fixer_test.py
@@ -24,9 +24,9 @@
(
b'-e git+ssh://git_url@tag#egg=ocflib\nDjango\nPyMySQL\n',
FAIL,
- b'Django\n-e git+ssh://git_url@tag#egg=ocflib\nPyMySQL\n'
+ b'Django\n-e git+ssh://git_url@tag#egg=ocflib\nPyMySQL\n',
),
- )
+ ),
)
def test_integration(input_s, expected_retval, output, tmpdir):
path = tmpdir.join('file.txt')
diff --git a/tests/trailing_whitespace_fixer_test.py b/tests/trailing_whitespace_fixer_test.py
index eb2a1d0..a771e67 100644
--- a/tests/trailing_whitespace_fixer_test.py
+++ b/tests/trailing_whitespace_fixer_test.py
@@ -69,7 +69,7 @@
path = tmpdir.join(filename)
path.write(input_s)
ret = fix_trailing_whitespace((
- '--markdown-linebreak-ext=TxT', path.strpath
+ '--markdown-linebreak-ext=TxT', path.strpath,
))
assert ret == 1
assert path.read() == output