From 6c4beef7837373b38f019a8869c6d617a6dcd90d Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 26 May 2016 23:50:58 +0200 Subject: [PATCH] Work around flake8-string-format bug When using flake8-string-format on Python 3.5 with str.format(*group) it failed: Traceback (most recent call last): File "./.venv-flakes/bin/flake8", line 11, in sys.exit(main()) File ".../site-packages/flake8/main.py", line 33, in main report = flake8_style.check_files() File ".../site-packages/flake8/engine.py", line 181, in check_files return self._retry_serial(self._styleguide.check_files, paths=paths) File ".../site-packages/flake8/engine.py", line 172, in _retry_serial return func(*args, **kwargs) File ".../site-packages/pep8.py", line 1842, in check_files runner(path) File ".../site-packages/flake8/engine.py", line 126, in input_file return fchecker.check_all(expected=expected, line_offset=line_offset) File ".../site-packages/pep8.py", line 1574, in check_all self.check_ast() File ".../site-packages/pep8.py", line 1521, in check_ast for lineno, offset, text, check in checker.run(): File ".../site-packages/flake8_string_format.py", line 288, in run assert isinstance(call.args, ast.Starred) is bool(has_starargs) AssertionError This works around that issue. See https://github.com/xZise/flake8-string-format/issues/11 --- tests/unit/misc/test_keyhints.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/misc/test_keyhints.py b/tests/unit/misc/test_keyhints.py index 6f705721d..75f2c5ebf 100644 --- a/tests/unit/misc/test_keyhints.py +++ b/tests/unit/misc/test_keyhints.py @@ -38,7 +38,7 @@ def expected_text(*args): "{}" "{}" "{}" - "").format(*group) + "").format(group[0], group[1], group[2], group[3]) return text + ''