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:
Victor Stinner 2014-02-26 10:25:02 +01:00
parent 71ec82a501
commit 24ba203504
12 changed files with 368 additions and 368 deletions

View file

@ -4,7 +4,7 @@ import functools
import gc
import socket
import unittest
import unittest.mock
from unittest import mock
try:
import ssl
except ImportError:
@ -29,7 +29,7 @@ class StreamReaderTests(unittest.TestCase):
self.loop.close()
gc.collect()
@unittest.mock.patch('asyncio.streams.events')
@mock.patch('asyncio.streams.events')
def test_ctor_global_loop(self, m_events):
stream = asyncio.StreamReader()
self.assertIs(stream._loop, m_events.get_event_loop.return_value)