summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_unix_events.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-02-19 00:40:41 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-02-19 00:40:41 (GMT)
commit065ca25aae644a0db313905319ce745fb2aead6c (patch)
tree11734d113e681c5160ef92edafda12133fad5ad7 /Lib/test/test_asyncio/test_unix_events.py
parentc098241342f9f0636e98b81d016564cc4153f158 (diff)
downloadcpython-065ca25aae644a0db313905319ce745fb2aead6c.zip
cpython-065ca25aae644a0db313905319ce745fb2aead6c.tar.gz
cpython-065ca25aae644a0db313905319ce745fb2aead6c.tar.bz2
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_unix_events.py')
-rw-r--r--Lib/test/test_asyncio/test_unix_events.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/Lib/test/test_asyncio/test_unix_events.py b/Lib/test/test_asyncio/test_unix_events.py
index e933079..9866e33 100644
--- a/Lib/test/test_asyncio/test_unix_events.py
+++ b/Lib/test/test_asyncio/test_unix_events.py
@@ -365,7 +365,7 @@ class UnixReadPipeTransportTests(unittest.TestCase):
tr._close.assert_called_with(err)
m_logexc.assert_called_with(
test_utils.MockPattern(
- 'Fatal transport error\nprotocol:.*\ntransport:.*'),
+ 'Fatal read error on pipe transport\nprotocol:.*\ntransport:.*'),
exc_info=(OSError, MOCK_ANY, MOCK_ANY))
@unittest.mock.patch('os.read')
@@ -558,7 +558,9 @@ class UnixWritePipeTransportTests(unittest.TestCase):
m_write.assert_called_with(5, b'data')
self.assertFalse(self.loop.writers)
self.assertEqual([], tr._buffer)
- tr._fatal_error.assert_called_with(err)
+ tr._fatal_error.assert_called_with(
+ err,
+ 'Fatal write error on pipe transport')
self.assertEqual(1, tr._conn_lost)
tr.write(b'data')
@@ -660,7 +662,7 @@ class UnixWritePipeTransportTests(unittest.TestCase):
self.assertTrue(tr._closing)
m_logexc.assert_called_with(
test_utils.MockPattern(
- 'Fatal transport error\nprotocol:.*\ntransport:.*'),
+ 'Fatal write error on pipe transport\nprotocol:.*\ntransport:.*'),
exc_info=(OSError, MOCK_ANY, MOCK_ANY))
self.assertEqual(1, tr._conn_lost)
test_utils.run_briefly(self.loop)