mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +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
|
@ -12,7 +12,7 @@ import tempfile
|
|||
import threading
|
||||
import time
|
||||
import unittest
|
||||
import unittest.mock
|
||||
from unittest import mock
|
||||
|
||||
from http.server import HTTPServer
|
||||
from wsgiref.simple_server import WSGIRequestHandler, WSGIServer
|
||||
|
@ -362,7 +362,7 @@ class TestLoop(base_events.BaseEventLoop):
|
|||
|
||||
|
||||
def MockCallback(**kwargs):
|
||||
return unittest.mock.Mock(spec=['__call__'], **kwargs)
|
||||
return mock.Mock(spec=['__call__'], **kwargs)
|
||||
|
||||
|
||||
class MockPattern(str):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue