@@ -225,7 +225,8 @@ def test_spawn_fail_check_execv_args(self):
225
225
226
226
def test_spawn_fail_make_pipes_emfile (self ):
227
227
options = DummyOptions ()
228
- options .make_pipes_exception = OSError (errno .EMFILE )
228
+ options .make_pipes_exception = OSError (errno .EMFILE ,
229
+ os .strerror (errno .EMFILE ))
229
230
config = DummyPConfig (options , 'good' , '/good/filename' )
230
231
instance = self ._makeOne (config )
231
232
from supervisor .states import ProcessStates
@@ -250,7 +251,8 @@ def test_spawn_fail_make_pipes_emfile(self):
250
251
251
252
def test_spawn_fail_make_pipes_other (self ):
252
253
options = DummyOptions ()
253
- options .make_pipes_exception = OSError (errno .EPERM )
254
+ options .make_pipes_exception = OSError (errno .EPERM ,
255
+ os .strerror (errno .EPERM ))
254
256
config = DummyPConfig (options , 'good' , '/good/filename' )
255
257
instance = self ._makeOne (config )
256
258
from supervisor .states import ProcessStates
@@ -301,7 +303,8 @@ def raise_eisdir(envelope):
301
303
302
304
def test_spawn_fork_fail_eagain (self ):
303
305
options = DummyOptions ()
304
- options .fork_exception = OSError (errno .EAGAIN )
306
+ options .fork_exception = OSError (errno .EAGAIN ,
307
+ os .strerror (errno .EAGAIN ))
305
308
config = DummyPConfig (options , 'good' , '/good/filename' )
306
309
instance = self ._makeOne (config )
307
310
from supervisor .states import ProcessStates
@@ -327,7 +330,8 @@ def test_spawn_fork_fail_eagain(self):
327
330
328
331
def test_spawn_fork_fail_other (self ):
329
332
options = DummyOptions ()
330
- options .fork_exception = OSError (errno .EPERM )
333
+ options .fork_exception = OSError (errno .EPERM ,
334
+ os .strerror (errno .EPERM ))
331
335
config = DummyPConfig (options , 'good' , '/good/filename' )
332
336
instance = self ._makeOne (config )
333
337
from supervisor .states import ProcessStates
@@ -436,7 +440,8 @@ def test_spawn_as_child_sets_umask(self):
436
440
def test_spawn_as_child_cwd_fail (self ):
437
441
options = DummyOptions ()
438
442
options .forkpid = 0
439
- options .chdir_exception = OSError (errno .ENOENT )
443
+ options .chdir_exception = OSError (errno .ENOENT ,
444
+ os .strerror (errno .ENOENT ))
440
445
config = DummyPConfig (options , 'good' , '/good/filename' ,
441
446
directory = '/tmp' )
442
447
instance = self ._makeOne (config )
@@ -458,7 +463,8 @@ def test_spawn_as_child_cwd_fail(self):
458
463
def test_spawn_as_child_execv_fail_oserror (self ):
459
464
options = DummyOptions ()
460
465
options .forkpid = 0
461
- options .execv_exception = OSError (errno .EPERM )
466
+ options .execv_exception = OSError (errno .EPERM ,
467
+ os .strerror (errno .EPERM ))
462
468
config = DummyPConfig (options , 'good' , '/good/filename' )
463
469
instance = self ._makeOne (config )
464
470
result = instance .spawn ()
@@ -641,7 +647,8 @@ def test_write_dispatcher_flush_raises_epipe(self):
641
647
options .forkpid = 1
642
648
instance .spawn ()
643
649
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 ))
645
652
self .assertRaises (OSError , instance .write , sent )
646
653
647
654
def _dont_test_spawn_and_kill (self ):
@@ -853,7 +860,8 @@ def test_kill_from_running(self):
853
860
def test_kill_from_running_error (self ):
854
861
options = DummyOptions ()
855
862
config = DummyPConfig (options , 'test' , '/test' )
856
- options .kill_exception = OSError (errno .EPERM )
863
+ options .kill_exception = OSError (errno .EPERM ,
864
+ os .strerror (errno .EPERM ))
857
865
instance = self ._makeOne (config )
858
866
L = []
859
867
from supervisor .states import ProcessStates
@@ -1002,7 +1010,8 @@ def kill(pid, sig):
1002
1010
def test_signal_from_running_error (self ):
1003
1011
options = DummyOptions ()
1004
1012
config = DummyPConfig (options , 'test' , '/test' )
1005
- options .kill_exception = OSError (errno .EPERM )
1013
+ options .kill_exception = OSError (errno .EPERM ,
1014
+ os .strerror (errno .EPERM ))
1006
1015
instance = self ._makeOne (config )
1007
1016
L = []
1008
1017
from supervisor .states import ProcessStates
@@ -2089,7 +2098,8 @@ def test_dispatch_pipe_error(self):
2089
2098
gconfig = DummyPGroupConfig (options , pconfigs = [pconfig1 ])
2090
2099
pool = self ._makeOne (gconfig )
2091
2100
process1 = pool .processes ['process1' ]
2092
- process1 .write_exception = OSError (errno .EPIPE )
2101
+ process1 .write_exception = OSError (errno .EPIPE ,
2102
+ os .strerror (errno .EPIPE ))
2093
2103
process1 .listener_state = EventListenerStates .READY
2094
2104
event = DummyEvent ()
2095
2105
pool ._acceptEvent (event )
0 commit comments