diff options
| author | Victor Stinner <victor.stinner@gmail.com> | 2015-01-21 22:40:19 (GMT) |
|---|---|---|
| committer | Victor Stinner <victor.stinner@gmail.com> | 2015-01-21 22:40:19 (GMT) |
| commit | 91d11bbb2d5742b291e48e9889bd9c51b0b39fb6 (patch) | |
| tree | 678a3dcfd28c30b19580e60fa4f1e2bad9f052bf /Lib/test | |
| parent | afb507c0024686237fd384ea06f934c9ac80741b (diff) | |
| parent | d0a28dee78d099fcadc71147cba4affb6efa0c97 (diff) | |
| download | cpython-91d11bbb2d5742b291e48e9889bd9c51b0b39fb6.zip cpython-91d11bbb2d5742b291e48e9889bd9c51b0b39fb6.tar.gz cpython-91d11bbb2d5742b291e48e9889bd9c51b0b39fb6.tar.bz2 | |
Merge 3.4 (asyncio)
Diffstat (limited to 'Lib/test')
| -rw-r--r-- | Lib/test/test_asyncio/test_proactor_events.py | 5 | ||||
| -rw-r--r-- | Lib/test/test_asyncio/test_streams.py | 10 |
2 files changed, 4 insertions, 11 deletions
diff --git a/Lib/test/test_asyncio/test_proactor_events.py b/Lib/test/test_asyncio/test_proactor_events.py index dee147e..33a8a67 100644 --- a/Lib/test/test_asyncio/test_proactor_events.py +++ b/Lib/test/test_asyncio/test_proactor_events.py @@ -523,9 +523,10 @@ class BaseProactorEventLoopTests(test_utils.TestCase): def test_loop_self_reading_exception(self): self.loop.close = mock.Mock() + self.loop.call_exception_handler = mock.Mock() self.proactor.recv.side_effect = OSError() - self.assertRaises(OSError, self.loop._loop_self_reading) - self.assertTrue(self.loop.close.called) + self.loop._loop_self_reading() + self.assertTrue(self.loop.call_exception_handler.called) def test_write_to_self(self): self.loop._write_to_self() diff --git a/Lib/test/test_asyncio/test_streams.py b/Lib/test/test_asyncio/test_streams.py index a18603a..2273049 100644 --- a/Lib/test/test_asyncio/test_streams.py +++ b/Lib/test/test_asyncio/test_streams.py @@ -415,10 +415,6 @@ class StreamReaderTests(test_utils.TestCase): def set_err(): stream.set_exception(ValueError()) - @asyncio.coroutine - def readline(): - yield from stream.readline() - t1 = asyncio.Task(stream.readline(), loop=self.loop) t2 = asyncio.Task(set_err(), loop=self.loop) @@ -429,11 +425,7 @@ class StreamReaderTests(test_utils.TestCase): def test_exception_cancel(self): stream = asyncio.StreamReader(loop=self.loop) - @asyncio.coroutine - def read_a_line(): - yield from stream.readline() - - t = asyncio.Task(read_a_line(), loop=self.loop) + t = asyncio.Task(stream.readline(), loop=self.loop) test_utils.run_briefly(self.loop) t.cancel() test_utils.run_briefly(self.loop) |
