pre-commit: upgrade flake8 3.7.7 -> 3.8.1

New errors:

    testing/test_setupplan.py:104:15: E741 ambiguous variable name 'l'
    testing/test_setupplan.py:107:15: E741 ambiguous variable name 'l'
    extra/get_issues.py:48:29: E741 ambiguous variable name 'l'
    testing/test_error_diffs.py:270:32: E741 ambiguous variable name 'l'

Not so sure about it but easier to just fix.

But more importantly, is a large amount of typing-related issues there
were fixed which necessitated noqa's which can now be removed.
This commit is contained in:
Ran Benita 2020-04-24 21:51:32 +03:00
parent 15d5e8cd97
commit d1534181c0
4 changed files with 10 additions and 6 deletions

View File

@ -21,11 +21,11 @@ repos:
exclude: _pytest/debugging.py
language_version: python3
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.7
rev: 3.8.1
hooks:
- id: flake8
language_version: python3
additional_dependencies: [flake8-typing-imports==1.3.0]
additional_dependencies: [flake8-typing-imports==1.9.0]
- repo: https://github.com/asottile/reorder_python_imports
rev: v1.4.0
hooks:

View File

@ -45,7 +45,7 @@ def main(args):
def _get_kind(issue):
labels = [l["name"] for l in issue["labels"]]
labels = [label["name"] for label in issue["labels"]]
for key in ("bug", "enhancement", "proposal"):
if key in labels:
return key

View File

@ -267,7 +267,7 @@ if sys.version_info[:2] >= (3, 7):
@pytest.mark.parametrize("code, expected", TESTCASES)
def test_error_diff(code, expected, testdir):
expected = [l.lstrip() for l in expected.splitlines()]
expected = [line.lstrip() for line in expected.splitlines()]
p = testdir.makepyfile(code)
result = testdir.runpytest(p, "-vv")
result.stdout.fnmatch_lines(expected)

View File

@ -101,10 +101,14 @@ def test_show_multi_test_fixture_setup_and_teardown_same_as_setup_show(testdir):
# the number and text of these lines should be identical
plan_lines = [
l for l in plan_result.stdout.lines if "SETUP" in l or "TEARDOWN" in l
line
for line in plan_result.stdout.lines
if "SETUP" in line or "TEARDOWN" in line
]
show_lines = [
l for l in show_result.stdout.lines if "SETUP" in l or "TEARDOWN" in l
line
for line in show_result.stdout.lines
if "SETUP" in line or "TEARDOWN" in line
]
assert plan_lines == show_lines