Skip to content

Commit 632af5e

Browse files
authored
Merge pull request #203 from graingert/remove-redundant-code
remove redundant unittest.mock imports
2 parents 27ef870 + a7d1c8f commit 632af5e

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
@@ -35,8 +34,6 @@ def _get_mock_module(config):
3534

3635
_get_mock_module._module = mock
3736
else:
38-
import unittest.mock
39-
4037
_get_mock_module._module = unittest.mock
4138

4239
return _get_mock_module._module
@@ -91,7 +88,7 @@ def spy(self, obj: object, name: str) -> unittest.mock.MagicMock:
9188
9289
:param object obj: An object.
9390
:param unicode name: A method in object.
94-
:rtype: mock.MagicMock
91+
:rtype: unittest.mock.MagicMock
9592
:return: Spy object.
9693
"""
9794
method = getattr(obj, name)
@@ -150,7 +147,7 @@ def stub(self, name: Optional[str] = None) -> unittest.mock.MagicMock:
150147
callbacks in tests.
151148
152149
:param name: the constructed stub's name as used in repr
153-
:rtype: mock.MagicMock
150+
:rtype: unittest.mock.MagicMock
154151
:return: Stub object.
155152
"""
156153
return cast(

0 commit comments

Comments
 (0)