@@ -225,7 +225,8 @@ def test_spawn_fail_check_execv_args(self):
225225
226226 def test_spawn_fail_make_pipes_emfile (self ):
227227 options = DummyOptions ()
228- options .make_pipes_exception = OSError (errno .EMFILE )
228+ options .make_pipes_exception = OSError (errno .EMFILE ,
229+ os .strerror (errno .EMFILE ))
229230 config = DummyPConfig (options , 'good' , '/good/filename' )
230231 instance = self ._makeOne (config )
231232 from supervisor .states import ProcessStates
@@ -250,7 +251,8 @@ def test_spawn_fail_make_pipes_emfile(self):
250251
251252 def test_spawn_fail_make_pipes_other (self ):
252253 options = DummyOptions ()
253- options .make_pipes_exception = OSError (errno .EPERM )
254+ options .make_pipes_exception = OSError (errno .EPERM ,
255+ os .strerror (errno .EPERM ))
254256 config = DummyPConfig (options , 'good' , '/good/filename' )
255257 instance = self ._makeOne (config )
256258 from supervisor .states import ProcessStates
@@ -301,7 +303,8 @@ def raise_eisdir(envelope):
301303
302304 def test_spawn_fork_fail_eagain (self ):
303305 options = DummyOptions ()
304- options .fork_exception = OSError (errno .EAGAIN )
306+ options .fork_exception = OSError (errno .EAGAIN ,
307+ os .strerror (errno .EAGAIN ))
305308 config = DummyPConfig (options , 'good' , '/good/filename' )
306309 instance = self ._makeOne (config )
307310 from supervisor .states import ProcessStates
@@ -327,7 +330,8 @@ def test_spawn_fork_fail_eagain(self):
327330
328331 def test_spawn_fork_fail_other (self ):
329332 options = DummyOptions ()
330- options .fork_exception = OSError (errno .EPERM )
333+ options .fork_exception = OSError (errno .EPERM ,
334+ os .strerror (errno .EPERM ))
331335 config = DummyPConfig (options , 'good' , '/good/filename' )
332336 instance = self ._makeOne (config )
333337 from supervisor .states import ProcessStates
@@ -436,7 +440,8 @@ def test_spawn_as_child_sets_umask(self):
436440 def test_spawn_as_child_cwd_fail (self ):
437441 options = DummyOptions ()
438442 options .forkpid = 0
439- options .chdir_exception = OSError (errno .ENOENT )
443+ options .chdir_exception = OSError (errno .ENOENT ,
444+ os .strerror (errno .ENOENT ))
440445 config = DummyPConfig (options , 'good' , '/good/filename' ,
441446 directory = '/tmp' )
442447 instance = self ._makeOne (config )
@@ -458,7 +463,8 @@ def test_spawn_as_child_cwd_fail(self):
458463 def test_spawn_as_child_execv_fail_oserror (self ):
459464 options = DummyOptions ()
460465 options .forkpid = 0
461- options .execv_exception = OSError (errno .EPERM )
466+ options .execv_exception = OSError (errno .EPERM ,
467+ os .strerror (errno .EPERM ))
462468 config = DummyPConfig (options , 'good' , '/good/filename' )
463469 instance = self ._makeOne (config )
464470 result = instance .spawn ()
@@ -641,7 +647,8 @@ def test_write_dispatcher_flush_raises_epipe(self):
641647 options .forkpid = 1
642648 instance .spawn ()
643649 stdin_fd = instance .pipes ['stdin' ]
644- instance .dispatchers [stdin_fd ].flush_exception = OSError (errno .EPIPE )
650+ instance .dispatchers [stdin_fd ].flush_exception = OSError (errno .EPIPE ,
651+ os .strerror (errno .EPIPE ))
645652 self .assertRaises (OSError , instance .write , sent )
646653
647654 def _dont_test_spawn_and_kill (self ):
@@ -853,7 +860,8 @@ def test_kill_from_running(self):
853860 def test_kill_from_running_error (self ):
854861 options = DummyOptions ()
855862 config = DummyPConfig (options , 'test' , '/test' )
856- options .kill_exception = OSError (errno .EPERM )
863+ options .kill_exception = OSError (errno .EPERM ,
864+ os .strerror (errno .EPERM ))
857865 instance = self ._makeOne (config )
858866 L = []
859867 from supervisor .states import ProcessStates
@@ -1002,7 +1010,8 @@ def kill(pid, sig):
10021010 def test_signal_from_running_error (self ):
10031011 options = DummyOptions ()
10041012 config = DummyPConfig (options , 'test' , '/test' )
1005- options .kill_exception = OSError (errno .EPERM )
1013+ options .kill_exception = OSError (errno .EPERM ,
1014+ os .strerror (errno .EPERM ))
10061015 instance = self ._makeOne (config )
10071016 L = []
10081017 from supervisor .states import ProcessStates
@@ -2089,7 +2098,8 @@ def test_dispatch_pipe_error(self):
20892098 gconfig = DummyPGroupConfig (options , pconfigs = [pconfig1 ])
20902099 pool = self ._makeOne (gconfig )
20912100 process1 = pool .processes ['process1' ]
2092- process1 .write_exception = OSError (errno .EPIPE )
2101+ process1 .write_exception = OSError (errno .EPIPE ,
2102+ os .strerror (errno .EPIPE ))
20932103 process1 .listener_state = EventListenerStates .READY
20942104 event = DummyEvent ()
20952105 pool ._acceptEvent (event )
0 commit comments