@@ -957,55 +957,27 @@ def test_stopasgroup(self):
957957
958958 def test_signal_from_stopped (self ):
959959 options = DummyOptions ()
960-
961- killedpid = []
962- killedsig = []
963-
964- def kill (pid , sig ):
965- killedpid .append (pid )
966- killedsig .append (sig )
967-
968- options .kill = kill #don't actually start killing random processes...
969-
970960 config = DummyPConfig (options , 'test' , '/test' )
971961 instance = self ._makeOne (config )
972- instance .pid = None
973-
974962 from supervisor .states import ProcessStates
975963 instance .state = ProcessStates .STOPPED
976-
977- instance .signal (signal .SIGWINCH )
978-
964+ instance .signal (signal .SIGWINCH )
979965 self .assertEqual (options .logger .data [0 ], "attempted to send test sig SIGWINCH "
980- "but it wasn't running" )
981-
982- self .assertEqual (killedpid , [])
966+ "but it wasn't running" )
967+ self .assertEqual (len (options .kills ), 0 )
983968
984969 def test_signal_from_running (self ):
985970 options = DummyOptions ()
986-
987- killedpid = []
988- killedsig = []
989-
990- def kill (pid , sig ):
991- killedpid .append (pid )
992- killedsig .append (sig )
993-
994- options .kill = kill
995-
996971 config = DummyPConfig (options , 'test' , '/test' )
997972 instance = self ._makeOne (config )
998973 instance .pid = 11
999-
1000974 from supervisor .states import ProcessStates
1001975 instance .state = ProcessStates .RUNNING
1002-
1003- instance .signal (signal .SIGWINCH )
1004-
1005- self .assertEqual (killedpid , [instance .pid ,])
1006- self .assertEqual (killedsig , [signal .SIGWINCH ,])
1007-
976+ instance .signal (signal .SIGWINCH )
1008977 self .assertEqual (options .logger .data [0 ], 'sending test (pid 11) sig SIGWINCH' )
978+ self .assertEqual (len (options .kills ), 1 )
979+ self .assertTrue (instance .pid in options .kills )
980+ self .assertEqual (options .kills [instance .pid ], signal .SIGWINCH )
1009981
1010982 def test_signal_from_running_error (self ):
1011983 options = DummyOptions ()
0 commit comments