#NEWLINE# def test_from_config_invalid_global_option( self ) : #NEWLINE# #INDENT# '\n    This test can be interpreted in two ways:\n      1. An invalid global option `invalid_global` will be caught.\n      2. Variable `invalid_global` is not allowed in [GLOBAL].\n    ' #NEWLINE# with temporary_dir ( root_dir = os . path . abspath ( '.' ) ) as tempdir : #NEWLINE# #INDENT# config_path = os . path . relpath ( os . path . join ( pants_run , 'config.ini' ) ) #NEWLINE# with open ( config_path , 'w+' ) as f : #NEWLINE# #INDENT# f . write ( dedent ( '\n          [DEFAULT]\n          some_crazy_thing: 123\n\n          [GLOBAL]\n          invalid_global: True\n          another_invalid_global: False\n\n          [test.junit]\n          fail_fast: True\n        ' ) ) #NEWLINE# #UNINDENT# pants_run = self . run_pants ( [ '--config-override={}' . format ( config_path ) , 'goals' ] ) #NEWLINE# self . assert_failure ( pants_run ) #NEWLINE# self . assertIn ( "ERROR] Invalid option 'invalid_global' under [GLOBAL]" , pants_run . stderr_data ) #NEWLINE# self . assertIn ( "ERROR] Invalid option 'another_invalid_global' under [GLOBAL]" , pants_run . stderr_data )