diff options
| author | Victor Stinner <victor.stinner@gmail.com> | 2014-01-25 15:32:06 +0100 |
|---|---|---|
| committer | Victor Stinner <victor.stinner@gmail.com> | 2014-01-25 15:32:06 +0100 |
| commit | 8dffc456d74a3a4395ac7a8f3957ff74f7f66753 (patch) | |
| tree | e6a0b0a8ceaea275bfba7276698842f3a0ab5d79 /Lib/test/test_asyncio/test_proactor_events.py | |
| parent | 75a5ec88ff41ad7d3909e54ce517754298b31404 (diff) | |
| download | cpython-git-8dffc456d74a3a4395ac7a8f3957ff74f7f66753.tar.gz | |
Update asyncio from the Tulip project
Major changes:
- StreamReader.readexactly() now raises an IncompleteReadError if the
end of stream is reached before we received enough bytes, instead of
returning less bytes than requested.
- Unit tests use the main asyncio module instead of submodules like events
- _UnixWritePipeTransport now also supports character devices, as
_UnixReadPipeTransport. Patch written by Jonathan Slenders.
- Export more symbols: BaseEventLoop, BaseProactorEventLoop,
BaseSelectorEventLoop, Queue and Queue sublasses, Empty, Full
Diffstat (limited to 'Lib/test/test_asyncio/test_proactor_events.py')
| -rw-r--r-- | Lib/test/test_asyncio/test_proactor_events.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Lib/test/test_asyncio/test_proactor_events.py b/Lib/test/test_asyncio/test_proactor_events.py index 9964f425d2..1c628000c5 100644 --- a/Lib/test/test_asyncio/test_proactor_events.py +++ b/Lib/test/test_asyncio/test_proactor_events.py @@ -5,7 +5,6 @@ import unittest import unittest.mock import asyncio -from asyncio.proactor_events import BaseProactorEventLoop from asyncio.proactor_events import _ProactorSocketTransport from asyncio.proactor_events import _ProactorWritePipeTransport from asyncio.proactor_events import _ProactorDuplexPipeTransport @@ -345,18 +344,18 @@ class BaseProactorEventLoopTests(unittest.TestCase): self.ssock, self.csock = unittest.mock.Mock(), unittest.mock.Mock() - class EventLoop(BaseProactorEventLoop): + class EventLoop(asyncio.BaseProactorEventLoop): def _socketpair(s): return (self.ssock, self.csock) self.loop = EventLoop(self.proactor) - @unittest.mock.patch.object(BaseProactorEventLoop, 'call_soon') - @unittest.mock.patch.object(BaseProactorEventLoop, '_socketpair') + @unittest.mock.patch.object(asyncio.BaseProactorEventLoop, 'call_soon') + @unittest.mock.patch.object(asyncio.BaseProactorEventLoop, '_socketpair') def test_ctor(self, socketpair, call_soon): ssock, csock = socketpair.return_value = ( unittest.mock.Mock(), unittest.mock.Mock()) - loop = BaseProactorEventLoop(self.proactor) + loop = asyncio.BaseProactorEventLoop(self.proactor) self.assertIs(loop._ssock, ssock) self.assertIs(loop._csock, csock) self.assertEqual(loop._internal_fds, 1) @@ -399,7 +398,7 @@ class BaseProactorEventLoopTests(unittest.TestCase): def test_socketpair(self): self.assertRaises( - NotImplementedError, BaseProactorEventLoop, self.proactor) + NotImplementedError, asyncio.BaseProactorEventLoop, self.proactor) def test_make_socket_transport(self): tr = self.loop._make_socket_transport(self.sock, unittest.mock.Mock()) |
