File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ def get_test_options(
145145 sub_test_name = opts .sub_test_name if require_sub_test_name else ""
146146 if require_sub_test_name and test_name in SUB_TEST_REQUIRED and not sub_test_name :
147147 raise ValueError (f"Test '{ test_name } ' requires a sub_test_name" )
148- handle_env_overrides (opts )
148+ handle_env_overrides (parser )
149149 if "auth" in test_name :
150150 opts .auth = True
151151 # 'auth_aws ecs' shouldn't have extra auth set.
@@ -158,15 +158,17 @@ def get_test_options(
158158 return opts , extra_opts
159159
160160
161- def handle_env_overrides (opts : argparse .Namespace ) -> None :
161+ def handle_env_overrides (parser : argparse . ArgumentParser , opts : argparse .Namespace ) -> None :
162162 # Get the options, and then allow environment variable overrides.
163163 for key in vars (opts ):
164164 if key in OPTION_TO_ENV_VAR :
165165 env_var = OPTION_TO_ENV_VAR [key ]
166166 else :
167167 env_var = key .upper ()
168168 if env_var in os .environ :
169- if env_var == "AUTH" :
169+ if parser .get_default (key ) != getattr (opts , key ):
170+ LOGGER .info ("Overriding env var '%s' with cli option" , env_var )
171+ elif env_var == "AUTH" :
170172 opts .auth = os .environ .get ("AUTH" ) == "auth"
171173 elif env_var == "SSL" :
172174 ssl_opt = os .environ .get ("SSL" , "" )
You can’t perform that action at this time.
0 commit comments