@@ -29,24 +29,16 @@ def setUp(self):
29
29
30
30
def tearDown (self ):
31
31
""" Reset all environment variables of consequence """
32
- if "AWS_EXECUTION_ENV" in os .environ :
33
- os .environ .pop ("AWS_EXECUTION_ENV" )
34
- if "INSTANA_EXTRA_HTTP_HEADERS" in os .environ :
35
- os .environ .pop ("INSTANA_EXTRA_HTTP_HEADERS" )
36
- if "INSTANA_ENDPOINT_URL" in os .environ :
37
- os .environ .pop ("INSTANA_ENDPOINT_URL" )
38
- if "INSTANA_ENDPOINT_PROXY" in os .environ :
39
- os .environ .pop ("INSTANA_ENDPOINT_PROXY" )
40
- if "INSTANA_AGENT_KEY" in os .environ :
41
- os .environ .pop ("INSTANA_AGENT_KEY" )
42
- if "INSTANA_LOG_LEVEL" in os .environ :
43
- os .environ .pop ("INSTANA_LOG_LEVEL" )
44
- if "INSTANA_SERVICE_NAME" in os .environ :
45
- os .environ .pop ("INSTANA_SERVICE_NAME" )
46
- if "INSTANA_SECRETS" in os .environ :
47
- os .environ .pop ("INSTANA_SECRETS" )
48
- if "INSTANA_TAGS" in os .environ :
49
- os .environ .pop ("INSTANA_TAGS" )
32
+ variable_names = (
33
+ "AWS_EXECUTION_ENV" , "INSTANA_EXTRA_HTTP_HEADERS" ,
34
+ "INSTANA_ENDPOINT_URL" , "INSTANA_ENDPOINT_PROXY" ,
35
+ "INSTANA_AGENT_KEY" , "INSTANA_LOG_LEVEL" ,
36
+ "INSTANA_SERVICE_NAME" , "INSTANA_SECRETS" , "INSTANA_TAGS" ,
37
+ )
38
+
39
+ for variable_name in variable_names :
40
+ if variable_name in os .environ :
41
+ os .environ .pop (variable_name )
50
42
51
43
set_agent (self .original_agent )
52
44
set_tracer (self .original_tracer )
0 commit comments