MCPcopy Index your code
hub / github.com/python/cpython / test_close_empty

Method test_close_empty

Lib/test/test__interpchannels.py:1090–1107  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1088 _channels.close(cid)
1089
1090 def test_close_empty(self):
1091 tests = [
1092 (False, False),
1093 (True, False),
1094 (False, True),
1095 (True, True),
1096 ]
1097 for send, recv in tests:
1098 with self.subTest((send, recv)):
1099 cid = _channels.create(REPLACE)
1100 _channels.send(cid, b'spam', blocking=False)
1101 recv_nowait(cid)
1102 _channels.close(cid, send=send, recv=recv)
1103
1104 with self.assertRaises(_channels.ChannelClosedError):
1105 _channels.send(cid, b'eggs')
1106 with self.assertRaises(_channels.ChannelClosedError):
1107 _channels.recv(cid)
1108
1109 def test_close_defaults_with_unused_items(self):
1110 cid = _channels.create(REPLACE)

Callers

nothing calls this directly

Calls 7

recv_nowaitFunction · 0.85
subTestMethod · 0.45
createMethod · 0.45
sendMethod · 0.45
closeMethod · 0.45
assertRaisesMethod · 0.45
recvMethod · 0.45

Tested by

no test coverage detected