#NEWLINE# @ pytest . mark . parametrize ( 'stdout_isatty' , [ True , False ] ) #NEWLINE# def test_output_option( httpbin , stdout_isatty ) : #NEWLINE# #INDENT# output_filename = os . path . join ( gettempdir ( ) , test_output_option . __name__ ) #NEWLINE# url = ( httpbin + '/robots.txt' ) #NEWLINE# r = http ( '--output' , output_filename , url , env = TestEnvironment ( stdout_isatty = stdout_isatty ) ) #NEWLINE# assert ( r == '' ) #NEWLINE# expected_body = urlopen ( url ) . read ( ) . decode ( ) #NEWLINE# with open ( output_filename , 'r' ) as f : #NEWLINE# #INDENT# actual_body = f . read ( ) #NEWLINE# #UNINDENT# assert ( actual_body == expected_body )