#NEWLINE# @ parameterized . expand ( [ ( 'too_many' , ( 1 , 2 , 3 ) , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) , ( 'too_few' , ( 1 , ) , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) , ( 'collision' , ( 1 , ) , { #NEWLINE# #INDENT# 'a' : 1 , #NEWLINE# #UNINDENT# } ) , ( 'unexpected' , ( 1 , ) , { #NEWLINE# #INDENT# 'q' : 1 , #NEWLINE# #UNINDENT# } ) ] ) #NEWLINE# def test_preprocess_doesnt_change_TypeErrors( self , name , args , kwargs ) : #NEWLINE# #INDENT# "\n        Verify that the validate decorator doesn't swallow typeerrors that\n        would be raised when calling a function with invalid arguments\n        " #NEWLINE# def undecorated( x , y ) : #NEWLINE# #INDENT# return ( x , y ) #NEWLINE# #UNINDENT# decorated = preprocess ( x = noop , y = noop ) ( undecorated ) #NEWLINE# with self . assertRaises ( TypeError ) as e : #NEWLINE# #INDENT# undecorated ( * args , ** kwargs ) #NEWLINE# #UNINDENT# undecorated_errargs = e . exception . args #NEWLINE# with self . assertRaises ( TypeError ) as e : #NEWLINE# #INDENT# decorated ( * args , ** kwargs ) #NEWLINE# #UNINDENT# decorated_errargs = e . exception . args #NEWLINE# self . assertEqual ( len ( decorated_errargs ) , 1 ) #NEWLINE# self . assertEqual ( len ( undecorated_errargs ) , 1 ) #NEWLINE# self . assertEqual ( decorated_errargs [ 0 ] , undecorated_errargs [ 0 ] )