Lines Matching refs:end
151 class ChannelAction(namedtuple('ChannelAction', 'action end interp')):
153 def __new__(cls, action, end=None, interp=None):
154 if not end:
155 end = 'both'
158 self = super().__new__(cls, action, end, interp)
163 if self.end not in ('same', 'opposite', 'send', 'recv'):
164 raise ValueError(self.end)
166 if self.end not in ('both', 'same', 'opposite', 'send', 'recv'):
167 raise ValueError(self.end)
173 def resolve_end(self, end):
174 if self.end == 'same':
175 return end
176 elif self.end == 'opposite':
177 return 'recv' if end == 'send' else 'send'
179 return self.end
221 def run_action(cid, action, end, state, *, hideclosed=True):
223 if action == 'use' and end == 'recv' and state.pending:
231 result = _run_action(cid, action, end, state)
242 def _run_action(cid, action, end, state):
244 if end == 'send':
247 elif end == 'recv':
259 raise ValueError(end)
262 if end in ('recv', 'send'):
263 kwargs[end] = True
270 if end in ('recv', 'send'):
271 kwargs[end] = True
784 script, file = _captured_script('print("it worked!", end="")')
792 script, file = _captured_script('print("it worked!", end="")')
809 print('it worked!', end='')
1080 self.assertEqual(cid.end, 'both')
1084 self.assertEqual(cid.end, 'send')
1087 self.assertEqual(cid.end, 'send')
1090 self.assertEqual(cid.end, 'recv')
1093 self.assertEqual(cid.end, 'recv')
1096 self.assertEqual(cid.end, 'both')
1213 # Test for a channel that has one end associated to an interpreter.
1266 # Should be one interpreter associated with each end.
1281 # Set up one channel with main interpreter on the send end and two
1282 # subinterpreters on the receive end.
1303 # Release the main interpreter from the send end.
1305 # Send end should have no associated interpreters.
1311 # Release one of the subinterpreters from the receive end.
1316 # Receive end should have the released interpreter removed.
1345 """Test listing channel interpreters with a channel's send end closed."""
1358 # Close the send end of the channel.
1360 # Send end should raise an error.
1363 # Receive end should not be closed (since channel is not empty).
1367 # Close the receive end of the channel from a subinterpreter.
1500 print(cid.end)
1520 print(chan.id.end)
1736 - end / opposite
1895 'end interp other extra creator')):
1901 def __new__(cls, end, interp, other, extra, creator):
1902 assert end in ('send', 'recv')
1916 self = super().__new__(cls, end, interp, other, extra, creator)
1940 def expect_closed_error(self, end=None):
1941 if end is None:
1942 end = self.end
1943 if end == 'recv' and self.state.closed == 'send':
2013 - end / opposite
2098 # only recv end used
2150 for end in ends:
2152 ChannelAction(op, end, interp),
2177 end = action.resolve_end(fix.end)
2184 end,
2195 {repr(end)},
2218 for end in ('send', 'recv'):
2219 yield ChannelCloseFixture(end, interp, other, extra, creator)
2223 close = ChannelAction(op, fix.end, 'same')
2288 print(' ', end='')
2289 print('.', end=''); sys.stdout.flush()