#NEWLINE# def test_use_after_close( container_factory , rabbit_manager , rabbit_config ) : #NEWLINE# #INDENT# container = container_factory ( FooService , rabbit_config ) #NEWLINE# container . start ( ) #NEWLINE# with ServiceRpcProxy ( 'foobar' , rabbit_config ) as proxy : #NEWLINE# #INDENT# proxy . spam ( ham = 1 ) #NEWLINE# pass #NEWLINE# #UNINDENT# with pytest . raises ( RuntimeError ) as exc : #NEWLINE# #INDENT# proxy . spam ( ham = 1 ) #NEWLINE# #UNINDENT# assert ( 'can no longer be used' in str ( container ) )