Skip to content

Commit 5ec86a5

Browse files
committed
Update pre-commit hooks
1 parent 766cccf commit 5ec86a5

File tree

5 files changed

+29
-21
lines changed

5 files changed

+29
-21
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
exclude: '^($|.*\.bin)'
22
repos:
33
- repo: https://github.com/ambv/black
4-
rev: 19.10b0
4+
rev: 20.8b1
55
hooks:
66
- id: black
77
args: [--safe, --quiet]
88
- repo: https://github.com/pre-commit/pre-commit-hooks
9-
rev: v2.5.0
9+
rev: v3.4.0
1010
hooks:
1111
- id: trailing-whitespace
1212
- id: end-of-file-fixer
@@ -19,7 +19,7 @@ repos:
1919
language: python
2020
additional_dependencies: [pygments, restructuredtext_lint]
2121
- repo: https://github.com/pre-commit/mirrors-mypy
22-
rev: v0.782 # NOTE: keep this in sync with tox.ini
22+
rev: v0.790 # NOTE: keep this in sync with tox.ini
2323
hooks:
2424
- id: mypy
2525
files: ^(src|tests)

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
packages=find_packages(where="src"),
99
package_dir={"": "src"},
1010
platforms="any",
11-
package_data={"pytest_mock": ["py.typed"],},
11+
package_data={
12+
"pytest_mock": ["py.typed"],
13+
},
1214
python_requires=">=3.5",
1315
install_requires=["pytest>=5.0"],
1416
use_scm_version={"write_to": "src/pytest_mock/_version.py"},

src/pytest_mock/__init__.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
from pytest_mock.plugin import *
1+
from pytest_mock.plugin import (
2+
MockerFixture,
3+
PytestMockWarning,
4+
pytest_addoption,
5+
pytest_configure,
6+
session_mocker,
7+
package_mocker,
8+
module_mocker,
9+
class_mocker,
10+
mocker,
11+
)
212

313
MockFixture = MockerFixture # backward-compatibility only (#204)
414

tests/test_pytest_mock.py

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,8 @@ def bar(self, arg):
249249
),
250250
)
251251
def test_instance_method_spy_exception(
252-
exc_cls: Type[BaseException], mocker: MockerFixture,
252+
exc_cls: Type[BaseException],
253+
mocker: MockerFixture,
253254
) -> None:
254255
class Foo:
255256
def bar(self, arg):
@@ -627,12 +628,12 @@ def test_foo(mocker):
627628

628629

629630
def test_parse_ini_boolean() -> None:
630-
import pytest_mock
631+
from pytest_mock._util import parse_ini_boolean
631632

632-
assert pytest_mock.parse_ini_boolean("True") is True
633-
assert pytest_mock.parse_ini_boolean("false") is False
633+
assert parse_ini_boolean("True") is True
634+
assert parse_ini_boolean("false") is False
634635
with pytest.raises(ValueError):
635-
pytest_mock.parse_ini_boolean("foo")
636+
parse_ini_boolean("foo")
636637

637638

638639
def test_patched_method_parameter_name(mocker: MockerFixture) -> None:
@@ -651,8 +652,7 @@ def request(cls, method, args):
651652

652653

653654
def test_monkeypatch_native(testdir: Any) -> None:
654-
"""Automatically disable monkeypatching when --tb=native.
655-
"""
655+
"""Automatically disable monkeypatching when --tb=native."""
656656
testdir.makepyfile(
657657
"""
658658
def test_foo(mocker):
@@ -676,8 +676,7 @@ def test_foo(mocker):
676676

677677

678678
def test_monkeypatch_no_terminal(testdir: Any) -> None:
679-
"""Don't crash without 'terminal' plugin.
680-
"""
679+
"""Don't crash without 'terminal' plugin."""
681680
testdir.makepyfile(
682681
"""
683682
def test_foo(mocker):
@@ -692,8 +691,7 @@ def test_foo(mocker):
692691

693692

694693
def test_standalone_mock(testdir: Any) -> None:
695-
"""Check that the "mock_use_standalone" is being used.
696-
"""
694+
"""Check that the "mock_use_standalone" is being used."""
697695
testdir.makepyfile(
698696
"""
699697
def test_foo(mocker):
@@ -713,8 +711,7 @@ def test_foo(mocker):
713711

714712
@pytest.mark.usefixtures("needs_assert_rewrite")
715713
def test_detailed_introspection(testdir: Any) -> None:
716-
"""Check that the "mock_use_standalone" is being used.
717-
"""
714+
"""Check that the "mock_use_standalone" is being used."""
718715
testdir.makepyfile(
719716
"""
720717
def test(mocker):
@@ -755,8 +752,7 @@ def test(mocker):
755752
)
756753
@pytest.mark.usefixtures("needs_assert_rewrite")
757754
def test_detailed_introspection_async(testdir: Any) -> None:
758-
"""Check that the "mock_use_standalone" is being used.
759-
"""
755+
"""Check that the "mock_use_standalone" is being used."""
760756
testdir.makepyfile(
761757
"""
762758
import pytest

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ commands = pre-commit run --all-files --show-diff-on-failure
2323
[testenv:mypy]
2424
skip_install = true
2525
deps =
26-
mypy==0.782
26+
mypy==0.790
2727
commands = mypy {posargs:src tests}
2828

2929
[pytest]

0 commit comments

Comments
 (0)