diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bf39e2a50f5..91b1474962d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,16 +1,16 @@ repos: - repo: https://github.com/psf/black - rev: 19.10b0 + rev: 20.8b1 hooks: - id: black args: [--safe, --quiet] - repo: https://github.com/asottile/blacken-docs - rev: v1.0.0 + rev: v1.8.0 hooks: - id: blacken-docs additional_dependencies: [black==19.10b0] - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.2.3 + rev: v3.3.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -18,18 +18,18 @@ repos: args: [--remove] - id: check-yaml - repo: https://gitlab.com/pycqa/flake8 - rev: 3.8.3 + rev: 3.8.4 hooks: - id: flake8 language_version: python3 additional_dependencies: [flake8-typing-imports==1.9.0] - repo: https://github.com/asottile/reorder_python_imports - rev: v1.4.0 + rev: v2.3.6 hooks: - id: reorder-python-imports args: ['--application-directories=.:src', --py3-plus] - repo: https://github.com/asottile/pyupgrade - rev: v1.18.0 + rev: v2.7.3 hooks: - id: pyupgrade args: [--keep-percent-format] diff --git a/src/_pytest/mark/__init__.py b/src/_pytest/mark/__init__.py index 3259345b146..7bdf8cf9af7 100644 --- a/src/_pytest/mark/__init__.py +++ b/src/_pytest/mark/__init__.py @@ -20,10 +20,10 @@ def param(*values, **kw): .. code-block:: python - @pytest.mark.parametrize("test_input,expected", [ - ("3+5", 8), - pytest.param("6*9", 42, marks=pytest.mark.xfail), - ]) + @pytest.mark.parametrize( + "test_input,expected", + [("3+5", 8), pytest.param("6*9", 42, marks=pytest.mark.xfail),], + ) def test_eval(test_input, expected): assert eval(test_input) == expected diff --git a/src/_pytest/monkeypatch.py b/src/_pytest/monkeypatch.py index 6dd7bd456c6..7bc08cd6294 100644 --- a/src/_pytest/monkeypatch.py +++ b/src/_pytest/monkeypatch.py @@ -137,6 +137,8 @@ def context(self) -> Generator["MonkeyPatch", None, None]: .. code-block:: python import functools + + def test_partial(monkeypatch): with monkeypatch.context() as m: m.setattr(functools, "partial", 3)