#NEWLINE# def check_argument_type( name , value ) : #NEWLINE# #INDENT# text = NamedTemporaryFile ( ) #NEWLINE# try : #NEWLINE# #INDENT# with patch ( 'sys.stderr' ) as mock_stderr : #NEWLINE# #INDENT# args = cli . parse_args ( [ '--text' , text . name , ( '--' + name ) , str ( value ) ] ) #NEWLINE# #UNINDENT# raise AssertionError ( 'argument "{}" was accepted even though the type did not match' . format ( text ) ) #NEWLINE# #UNINDENT# except SystemExit : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# pass