summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_unix_events.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-07-23 16:21:45 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-07-23 16:21:45 (GMT)
commitc4c464911ab6a65a32b8b2162aa4537003efb87b (patch)
tree369d3f7c444adf385ed99346870dce3f894da3bd /Lib/test/test_asyncio/test_unix_events.py
parent8966759b031ce9977e038c5db1d8ed47c6c827a6 (diff)
downloadcpython-c4c464911ab6a65a32b8b2162aa4537003efb87b.zip
cpython-c4c464911ab6a65a32b8b2162aa4537003efb87b.tar.gz
cpython-c4c464911ab6a65a32b8b2162aa4537003efb87b.tar.bz2
asyncio: sync with Tulip
* Tulip issue 194: Don't use sys.getrefcount() in unit tests * signal.set_wakeup_fd() can now raise an OSError on Python 3.5
Diffstat (limited to 'Lib/test/test_asyncio/test_unix_events.py')
-rw-r--r--Lib/test/test_asyncio/test_unix_events.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/Lib/test/test_asyncio/test_unix_events.py b/Lib/test/test_asyncio/test_unix_events.py
index d355def..099d4d5 100644
--- a/Lib/test/test_asyncio/test_unix_events.py
+++ b/Lib/test/test_asyncio/test_unix_events.py
@@ -435,6 +435,8 @@ class UnixReadPipeTransportTests(test_utils.TestCase):
def test__call_connection_lost(self):
tr = unix_events._UnixReadPipeTransport(
self.loop, self.pipe, self.protocol)
+ self.assertIsNotNone(tr._protocol)
+ self.assertIsNotNone(tr._loop)
err = None
tr._call_connection_lost(err)
@@ -442,13 +444,13 @@ class UnixReadPipeTransportTests(test_utils.TestCase):
self.pipe.close.assert_called_with()
self.assertIsNone(tr._protocol)
- self.assertEqual(2, sys.getrefcount(self.protocol),
- pprint.pformat(gc.get_referrers(self.protocol)))
self.assertIsNone(tr._loop)
def test__call_connection_lost_with_err(self):
tr = unix_events._UnixReadPipeTransport(
self.loop, self.pipe, self.protocol)
+ self.assertIsNotNone(tr._protocol)
+ self.assertIsNotNone(tr._loop)
err = OSError()
tr._call_connection_lost(err)
@@ -456,9 +458,6 @@ class UnixReadPipeTransportTests(test_utils.TestCase):
self.pipe.close.assert_called_with()
self.assertIsNone(tr._protocol)
-
- self.assertEqual(2, sys.getrefcount(self.protocol),
- pprint.pformat(gc.get_referrers(self.protocol)))
self.assertIsNone(tr._loop)
@@ -717,6 +716,8 @@ class UnixWritePipeTransportTests(test_utils.TestCase):
def test__call_connection_lost(self):
tr = unix_events._UnixWritePipeTransport(
self.loop, self.pipe, self.protocol)
+ self.assertIsNotNone(tr._protocol)
+ self.assertIsNotNone(tr._loop)
err = None
tr._call_connection_lost(err)
@@ -724,13 +725,13 @@ class UnixWritePipeTransportTests(test_utils.TestCase):
self.pipe.close.assert_called_with()
self.assertIsNone(tr._protocol)
- self.assertEqual(2, sys.getrefcount(self.protocol),
- pprint.pformat(gc.get_referrers(self.protocol)))
self.assertIsNone(tr._loop)
def test__call_connection_lost_with_err(self):
tr = unix_events._UnixWritePipeTransport(
self.loop, self.pipe, self.protocol)
+ self.assertIsNotNone(tr._protocol)
+ self.assertIsNotNone(tr._loop)
err = OSError()
tr._call_connection_lost(err)
@@ -738,8 +739,6 @@ class UnixWritePipeTransportTests(test_utils.TestCase):
self.pipe.close.assert_called_with()
self.assertIsNone(tr._protocol)
- self.assertEqual(2, sys.getrefcount(self.protocol),
- pprint.pformat(gc.get_referrers(self.protocol)))
self.assertIsNone(tr._loop)
def test_close(self):