Skip to content

Commit a7d1c8f

Browse files
committed
remove redundant unittest.mock imports
1 parent 03da957 commit a7d1c8f

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/pytest_mock/plugin.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from typing import Union
1111

1212

13-
from unittest import mock
1413
import asyncio
1514
import functools
1615
import inspect
@@ -33,8 +32,6 @@ def _get_mock_module(config):
3332

3433
_get_mock_module._module = mock
3534
else:
36-
import unittest.mock
37-
3835
_get_mock_module._module = unittest.mock
3936

4037
return _get_mock_module._module
@@ -87,7 +84,7 @@ def spy(self, obj: object, name: str) -> unittest.mock.MagicMock:
8784
8885
:param object obj: An object.
8986
:param unicode name: A method in object.
90-
:rtype: mock.MagicMock
87+
:rtype: unittest.mock.MagicMock
9188
:return: Spy object.
9289
"""
9390
method = getattr(obj, name)
@@ -146,7 +143,7 @@ def stub(self, name: Optional[str] = None) -> unittest.mock.MagicMock:
146143
callbacks in tests.
147144
148145
:param name: the constructed stub's name as used in repr
149-
:rtype: mock.MagicMock
146+
:rtype: unittest.mock.MagicMock
150147
:return: Stub object.
151148
"""
152149
return cast(

0 commit comments

Comments
 (0)