From 673ed962b0d68bfbff4c10af9b83784449013328 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sat, 7 Mar 2020 01:30:38 +0100 Subject: [PATCH 1/2] pre-commit: black: --target-version py35 This is meant to avoid having trailing commas after `**kwargs`, which only works in Python 3.5.2+. --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2e6b43ac8ea..aac3beda92a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ repos: rev: 19.10b0 hooks: - id: black - args: [--safe, --quiet] + args: [--safe, --quiet, --target-version, py35] - repo: https://github.com/asottile/blacken-docs rev: v1.0.0 hooks: From 1ca9e18c7f610870e0d50ef1d80a8ad1135c26b8 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sat, 7 Mar 2020 01:40:48 +0100 Subject: [PATCH 2/2] pre-commit run --all-files --- src/_pytest/fixtures.py | 4 ++-- testing/test_capture.py | 2 +- testing/test_config.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index cdd249d93a6..b39503f0e20 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -1141,7 +1141,7 @@ def fixture( params=params, autouse=autouse, ids=ids, - name=name + name=name, ) scope = arguments.get("scope") params = arguments.get("params") @@ -1179,7 +1179,7 @@ def yield_fixture( params=params, autouse=autouse, ids=ids, - name=name + name=name, ) diff --git a/testing/test_capture.py b/testing/test_capture.py index 20a5dd5762b..b8f38419376 100644 --- a/testing/test_capture.py +++ b/testing/test_capture.py @@ -439,7 +439,7 @@ def test_hello(capsys): out, err = capsys.readouterr() assert out.startswith("42") """, - *opt + *opt, ) reprec.assertoutcome(passed=1) diff --git a/testing/test_config.py b/testing/test_config.py index 308b9c71f5f..66fecbefb65 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -733,7 +733,7 @@ def pytest_sessionstart(session): config = session.config terminal_plugin.append(bool(config.pluginmanager.get_plugin("terminalreporter"))) """ - } + }, ) testdir.syspathinsert() result = testdir.runpytest("-p", "myplugin", str(p1)) @@ -812,7 +812,7 @@ def pytest_addoption(parser): testdir.makefile( ".ini", - **{"pytest": "[pytest]\nfoo = root", "subdir/pytest": "[pytest]\nfoo = subdir"} + **{"pytest": "[pytest]\nfoo = root", "subdir/pytest": "[pytest]\nfoo = subdir"}, ) testdir.makepyfile(