#NEWLINE# def test_register_non_type_coder( self ) : #NEWLINE# #INDENT# coder = CustomCoder ( ) #NEWLINE# with self . assertRaises ( TypeError ) as e : #NEWLINE# #INDENT# typecoders . registry . register_coder ( CustomClass , coder ) #NEWLINE# #UNINDENT# self . assertEqual ( e . exception . message , ( 'Coder registration requires a coder class object. Received %r instead.' % coder ) )