mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +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
|
@ -1,7 +1,7 @@
|
|||
"""Tests for queues.py"""
|
||||
|
||||
import unittest
|
||||
import unittest.mock
|
||||
from unittest import mock
|
||||
|
||||
import asyncio
|
||||
from asyncio import test_utils
|
||||
|
@ -72,7 +72,7 @@ class QueueBasicTests(_QueueTestBase):
|
|||
self.assertTrue('_queue=[1]' in fn(q))
|
||||
|
||||
def test_ctor_loop(self):
|
||||
loop = unittest.mock.Mock()
|
||||
loop = mock.Mock()
|
||||
q = asyncio.Queue(loop=loop)
|
||||
self.assertIs(q._loop, loop)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue