diff options
| author | Victor Stinner <victor.stinner@gmail.com> | 2014-02-19 01:40:41 +0100 |
|---|---|---|
| committer | Victor Stinner <victor.stinner@gmail.com> | 2014-02-19 01:40:41 +0100 |
| commit | 065ca25aae644a0db313905319ce745fb2aead6c (patch) | |
| tree | 11734d113e681c5160ef92edafda12133fad5ad7 /Lib/test/test_asyncio/test_proactor_events.py | |
| parent | c098241342f9f0636e98b81d016564cc4153f158 (diff) | |
| download | cpython-git-065ca25aae644a0db313905319ce745fb2aead6c.tar.gz | |
asyncio, Tulip issue 139: Improve error messages on "fatal errors"
Mention if the error was caused by a read or a write, and be more specific on
the object (ex: "pipe transport" instead of "transport").
Diffstat (limited to 'Lib/test/test_asyncio/test_proactor_events.py')
| -rw-r--r-- | Lib/test/test_asyncio/test_proactor_events.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Lib/test/test_asyncio/test_proactor_events.py b/Lib/test/test_asyncio/test_proactor_events.py index 816c9732b0..08920690b8 100644 --- a/Lib/test/test_asyncio/test_proactor_events.py +++ b/Lib/test/test_asyncio/test_proactor_events.py @@ -69,7 +69,9 @@ class ProactorSocketTransportTests(unittest.TestCase): tr = _ProactorSocketTransport(self.loop, self.sock, self.protocol) tr._fatal_error = unittest.mock.Mock() tr._loop_reading() - tr._fatal_error.assert_called_with(err) + tr._fatal_error.assert_called_with( + err, + 'Fatal read error on pipe transport') def test_loop_reading_aborted_closing(self): self.loop._proactor.recv.side_effect = ConnectionAbortedError() @@ -105,7 +107,9 @@ class ProactorSocketTransportTests(unittest.TestCase): tr = _ProactorSocketTransport(self.loop, self.sock, self.protocol) tr._fatal_error = unittest.mock.Mock() tr._loop_reading() - tr._fatal_error.assert_called_with(err) + tr._fatal_error.assert_called_with( + err, + 'Fatal read error on pipe transport') def test_write(self): tr = _ProactorSocketTransport(self.loop, self.sock, self.protocol) @@ -142,7 +146,9 @@ class ProactorSocketTransportTests(unittest.TestCase): tr._fatal_error = unittest.mock.Mock() tr._buffer = [b'da', b'ta'] tr._loop_writing() - tr._fatal_error.assert_called_with(err) + tr._fatal_error.assert_called_with( + err, + 'Fatal write error on pipe transport') tr._conn_lost = 1 tr.write(b'data') |
