#NEWLINE# def test_nargs_tup_composite( runner ) : #NEWLINE# #INDENT# variations = [ dict ( type = ( str , int ) ) , dict ( type = click . Tuple ( [ str , int ] ) ) , dict ( nargs = 2 , type = click . Tuple ( [ str , int ] ) ) , dict ( nargs = 2 , type = ( str , int ) ) ] #NEWLINE# for opts in variations : #NEWLINE# #INDENT# @ click . command ( ) #NEWLINE# @ click . argument ( 'item' , ** opts ) #NEWLINE# def copy( item ) : #NEWLINE# #INDENT# click . echo ( ( 'name=%s id=%d' % item ) ) #NEWLINE# #UNINDENT# result = runner . invoke ( copy , [ 'peter' , '1' ] ) #NEWLINE# assert ( not result . exception ) #NEWLINE# assert ( result . output . splitlines ( ) == [ 'name=peter id=1' ] )