#NEWLINE# def test_other_error( container_factory , web_config , web_config_port , web_session ) : #NEWLINE# #INDENT# container = container_factory ( ExampleService , container ) #NEWLINE# container . start ( ) #NEWLINE# s = socket . socket ( socket . AF_INET , socket . SOCK_STREAM ) #NEWLINE# s . connect ( ( '127.0.0.1' , web_config_port ) ) #NEWLINE# with patch . object ( BaseHTTPServer . BaseHTTPRequestHandler , 'finish' ) as fin : #NEWLINE# #INDENT# fin . side_effect = socket . error ( 'boom' ) #NEWLINE# s . sendall ( b'GET / \r\n\r\n' ) #NEWLINE# s . recv ( 10 ) #NEWLINE# s . close ( ) #NEWLINE# #UNINDENT# with pytest . raises ( socket . error ) as exc : #NEWLINE# #INDENT# container . wait ( ) #NEWLINE# #UNINDENT# assert ( 'boom' in str ( exc ) )