33import re
44import sys
55from contextlib import contextmanager
6- from typing import Callable , Any , Tuple , Generator , Type
6+ from typing import Any
7+ from typing import Callable
8+ from typing import Generator
9+ from typing import Tuple
10+ from typing import Type
711from unittest .mock import MagicMock
812
913import pytest
10- from pytest_mock import MockerFixture , PytestMockWarning
14+
15+ from pytest_mock import MockerFixture
16+ from pytest_mock import PytestMockWarning
1117
1218pytest_plugins = "pytester"
1319
@@ -249,7 +255,8 @@ def bar(self, arg):
249255 ),
250256)
251257def test_instance_method_spy_exception (
252- exc_cls : Type [BaseException ], mocker : MockerFixture ,
258+ exc_cls : Type [BaseException ],
259+ mocker : MockerFixture ,
253260) -> None :
254261 class Foo :
255262 def bar (self , arg ):
@@ -627,12 +634,12 @@ def test_foo(mocker):
627634
628635
629636def test_parse_ini_boolean () -> None :
630- import pytest_mock
637+ from pytest_mock . _util import parse_ini_boolean
631638
632- assert pytest_mock . parse_ini_boolean ("True" ) is True
633- assert pytest_mock . parse_ini_boolean ("false" ) is False
639+ assert parse_ini_boolean ("True" ) is True
640+ assert parse_ini_boolean ("false" ) is False
634641 with pytest .raises (ValueError ):
635- pytest_mock . parse_ini_boolean ("foo" )
642+ parse_ini_boolean ("foo" )
636643
637644
638645def test_patched_method_parameter_name (mocker : MockerFixture ) -> None :
@@ -651,8 +658,7 @@ def request(cls, method, args):
651658
652659
653660def test_monkeypatch_native (testdir : Any ) -> None :
654- """Automatically disable monkeypatching when --tb=native.
655- """
661+ """Automatically disable monkeypatching when --tb=native."""
656662 testdir .makepyfile (
657663 """
658664 def test_foo(mocker):
@@ -676,8 +682,7 @@ def test_foo(mocker):
676682
677683
678684def test_monkeypatch_no_terminal (testdir : Any ) -> None :
679- """Don't crash without 'terminal' plugin.
680- """
685+ """Don't crash without 'terminal' plugin."""
681686 testdir .makepyfile (
682687 """
683688 def test_foo(mocker):
@@ -692,8 +697,7 @@ def test_foo(mocker):
692697
693698
694699def test_standalone_mock (testdir : Any ) -> None :
695- """Check that the "mock_use_standalone" is being used.
696- """
700+ """Check that the "mock_use_standalone" is being used."""
697701 testdir .makepyfile (
698702 """
699703 def test_foo(mocker):
@@ -713,8 +717,7 @@ def test_foo(mocker):
713717
714718@pytest .mark .usefixtures ("needs_assert_rewrite" )
715719def test_detailed_introspection (testdir : Any ) -> None :
716- """Check that the "mock_use_standalone" is being used.
717- """
720+ """Check that the "mock_use_standalone" is being used."""
718721 testdir .makepyfile (
719722 """
720723 def test(mocker):
@@ -755,8 +758,7 @@ def test(mocker):
755758)
756759@pytest .mark .usefixtures ("needs_assert_rewrite" )
757760def test_detailed_introspection_async (testdir : Any ) -> None :
758- """Check that the "mock_use_standalone" is being used.
759- """
761+ """Check that the "mock_use_standalone" is being used."""
760762 testdir .makepyfile (
761763 """
762764 import pytest
0 commit comments