aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_asyncio/test_transports.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-02-26 10:25:02 +0100
committerVictor Stinner <victor.stinner@gmail.com>2014-02-26 10:25:02 +0100
commit24ba2035048566df2e0876fb719749d984234bc7 (patch)
treed7e3aea3b21b945a2f475247384878ca7723a415 /Lib/test/test_asyncio/test_transports.py
parent71ec82a501d95c43aa6c3559e8dbd05aad23eb50 (diff)
downloadcpython-24ba2035048566df2e0876fb719749d984234bc7.tar.gz
cpython-24ba2035048566df2e0876fb719749d984234bc7.zip
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.
Diffstat (limited to 'Lib/test/test_asyncio/test_transports.py')
-rw-r--r--Lib/test/test_asyncio/test_transports.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_asyncio/test_transports.py b/Lib/test/test_asyncio/test_transports.py
index 4c645268d94..cfbdf3e9bcc 100644
--- a/Lib/test/test_asyncio/test_transports.py
+++ b/Lib/test/test_asyncio/test_transports.py
@@ -1,7 +1,7 @@
"""Tests for transports.py."""
import unittest
-import unittest.mock
+from unittest import mock
import asyncio
from asyncio import transports
@@ -23,7 +23,7 @@ class TransportTests(unittest.TestCase):
def test_writelines(self):
transport = asyncio.Transport()
- transport.write = unittest.mock.Mock()
+ transport.write = mock.Mock()
transport.writelines([b'line1',
bytearray(b'line2'),
@@ -70,7 +70,7 @@ class TransportTests(unittest.TestCase):
return 512
transport = MyTransport()
- transport._protocol = unittest.mock.Mock()
+ transport._protocol = mock.Mock()
self.assertFalse(transport._protocol_paused)