@@ -271,15 +271,17 @@ def _mock_select(self, rfds, wfds, xfds):
271
271
# called with three empty lists as file descriptors to wait
272
272
# on. Behavior of real select is platform-dependent and
273
273
# likely infinite blocking on Linux.
274
- raise self .fail ("mock select on no waitables" )
274
+ self .fail ("mock select on no waitables" )
275
275
rfds_result = self .select_rfds_results .pop (0 )
276
276
277
277
if rfds_result is _MockSelectEternalWait :
278
278
raise _MockSelectEternalWait
279
279
return rfds_result , [], []
280
280
281
281
def test__mock_stdin_stdout (self ):
282
- self .assertGreater (pty .STDIN_FILENO , 2 , "replaced by our mock" )
282
+ """Test that _mock_stdin_stdout was called during setUp."""
283
+ self .assertGreater (pty .STDIN_FILENO , 2 , "stdin replaced by our mock" )
284
+ self .assertGreater (pty .STDOUT_FILENO , 2 , "stdout replaced by our mock" )
283
285
284
286
def test__mock_select (self ):
285
287
# Test the select proxy of this test class. Meta testing.
@@ -366,18 +368,6 @@ def _copy_eof_close_slave_helper(self, close_stdin):
366
368
self .assertEqual (self .select_rfds_results , [])
367
369
self .assertEqual (self .select_rfds_lengths , [])
368
370
369
- # Test that STDIN was not touched. This test simulated the
370
- # scenario where the child process immediately closed its end of
371
- # the pipe. This means, nothing should be copied.
372
- rfds = select .select ([self .read_from_stdout_fd , pty .STDIN_FILENO ], [], [], 0 )[0 ]
373
- # data or EOF is still sitting unconsumed in STDIN
374
- self .assertEqual (rfds , [pty .STDIN_FILENO ])
375
- unconsumed = os .read (pty .STDIN_FILENO , 20 )
376
- if close_stdin :
377
- self .assertFalse (unconsumed ) #EOF
378
- else :
379
- self .assertEqual (unconsumed , b'from stdin' )
380
-
381
371
def test__copy_eof_on_all (self ):
382
372
# Test the empty read EOF case on both master_fd and stdin.
383
373
self ._copy_eof_close_slave_helper (close_stdin = True )
0 commit comments