Skip to content

Commit

Permalink
Merge pull request #203 from graingert/remove-redundant-code
Browse files Browse the repository at this point in the history
remove redundant unittest.mock imports
  • Loading branch information
nicoddemus committed Aug 29, 2020
2 parents 27ef870 + a7d1c8f commit 632af5e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/pytest_mock/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from typing import Union


from unittest import mock
import asyncio
import functools
import inspect
Expand All @@ -35,8 +34,6 @@ def _get_mock_module(config):

_get_mock_module._module = mock
else:
import unittest.mock

_get_mock_module._module = unittest.mock

return _get_mock_module._module
Expand Down Expand Up @@ -91,7 +88,7 @@ def spy(self, obj: object, name: str) -> unittest.mock.MagicMock:
:param object obj: An object.
:param unicode name: A method in object.
:rtype: mock.MagicMock
:rtype: unittest.mock.MagicMock
:return: Spy object.
"""
method = getattr(obj, name)
Expand Down Expand Up @@ -150,7 +147,7 @@ def stub(self, name: Optional[str] = None) -> unittest.mock.MagicMock:
callbacks in tests.
:param name: the constructed stub's name as used in repr
:rtype: mock.MagicMock
:rtype: unittest.mock.MagicMock
:return: Stub object.
"""
return cast(
Expand Down

0 comments on commit 632af5e

Please sign in to comment.