From 04101b9c0a029685f98949f613f2d6167431a269 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20HUBSCHER?= Date: Wed, 5 Feb 2020 18:36:50 +0100 Subject: [PATCH] Update tests. --- pre_commit_hooks/trailing_whitespace_fixer.py | 5 ++++- tests/trailing_whitespace_fixer_test.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pre_commit_hooks/trailing_whitespace_fixer.py b/pre_commit_hooks/trailing_whitespace_fixer.py index f005784..42c5ae2 100644 --- a/pre_commit_hooks/trailing_whitespace_fixer.py +++ b/pre_commit_hooks/trailing_whitespace_fixer.py @@ -86,7 +86,10 @@ def main(argv=None): # type: (Optional[Sequence[str]]) -> int chars = None if args.chars is None else args.chars.encode('utf-8') return_code = 0 for filename in args.filenames: - in_md_exts = any([filename for ext in md_exts if filename.endswith(ext)]) + in_md_exts = any([ + filename for ext in md_exts + if filename.endswith(ext) + ]) md = all_markdown or in_md_exts if _fix_file(filename, md, chars): print('Fixing {}'.format(filename)) diff --git a/tests/trailing_whitespace_fixer_test.py b/tests/trailing_whitespace_fixer_test.py index 0d2c440..fd49903 100644 --- a/tests/trailing_whitespace_fixer_test.py +++ b/tests/trailing_whitespace_fixer_test.py @@ -57,7 +57,7 @@ def test_fixes_markdown_files(tmpdir, ext): ) -@pytest.mark.parametrize('arg', ('--', 'a.b', 'a/b', '')) +@pytest.mark.parametrize('arg', ('--', 'a/b', '')) def test_markdown_linebreak_ext_badopt(arg): with pytest.raises(SystemExit) as excinfo: main(['--markdown-linebreak-ext', arg])