mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
asyncio: Replace "unittest.mock" with "mock" in unit tests
Use "from unittest import mock". It should simplify my work to merge new tests in Trollius, because Trollius uses "mock" backport for Python 2.
This commit is contained in:
parent
71ec82a501
commit
24ba203504
12 changed files with 368 additions and 368 deletions
|
@ -3,7 +3,7 @@
|
|||
import sys
|
||||
import test.support
|
||||
import unittest
|
||||
import unittest.mock
|
||||
from unittest import mock
|
||||
|
||||
if sys.platform != 'win32':
|
||||
raise unittest.SkipTest('Windows only')
|
||||
|
@ -25,7 +25,7 @@ class WinsocketpairTests(unittest.TestCase):
|
|||
csock.close()
|
||||
ssock.close()
|
||||
|
||||
@unittest.mock.patch('asyncio.windows_utils.socket')
|
||||
@mock.patch('asyncio.windows_utils.socket')
|
||||
def test_winsocketpair_exc(self, m_socket):
|
||||
m_socket.socket.return_value.getsockname.return_value = ('', 12345)
|
||||
m_socket.socket.return_value.accept.return_value = object(), object()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue