#NEWLINE# def test_defaults_for_nargs( runner ) : #NEWLINE# #INDENT# @ click . command ( ) #NEWLINE# @ click . argument ( 'a' , nargs = 2 , type = int , default = ( 1 , 2 ) ) #NEWLINE# def cmd( a ) : #NEWLINE# #INDENT# ( x , y ) = a #NEWLINE# click . echo ( ( x + y ) ) #NEWLINE# #UNINDENT# result = runner . invoke ( cmd , [ ] ) #NEWLINE# assert ( result . output . strip ( ) == '3' ) #NEWLINE# result = runner . invoke ( cmd , [ '3' , '4' ] ) #NEWLINE# assert ( result . output . strip ( ) == '7' ) #NEWLINE# result = runner . invoke ( cmd , [ '3' ] ) #NEWLINE# assert ( result . exception is not None ) #NEWLINE# assert ( 'argument a takes 2 values' in result . output )