@@ -64,8 +64,14 @@ def s3_bucket(self, get_s3):
64
64
def case_name (self , request ):
65
65
self .testcase = request .node .name
66
66
67
+ @pytest .fixture (autouse = True )
68
+ def internal_check (self , check_internal ):
69
+ self .internal = check_internal
70
+
67
71
@classmethod
68
- @pytest .mark .usefixtures ("get_prefix" , "get_stage" , "check_internal" , "parameter_values" , "get_s3" )
72
+ @pytest .mark .usefixtures (
73
+ "get_prefix" , "get_stage" , "check_internal" , "parameter_values" , "get_s3" , "check_internal"
74
+ )
69
75
def setUpClass (cls ):
70
76
cls .FUNCTION_OUTPUT = "hello"
71
77
cls .tests_integ_dir = Path (__file__ ).resolve ().parents [1 ]
@@ -560,10 +566,11 @@ def do_get_request_with_logging(self, url, headers=None):
560
566
"""
561
567
response = requests .get (url , headers = headers ) if headers else requests .get (url )
562
568
amazon_headers = RequestUtils (response ).get_amazon_headers ()
563
- REQUEST_LOGGER .info (
564
- "Request made to " + url ,
565
- extra = {"test" : self .testcase , "status" : response .status_code , "headers" : amazon_headers },
566
- )
569
+ if self .internal :
570
+ REQUEST_LOGGER .info (
571
+ "Request made to " + url ,
572
+ extra = {"test" : self .testcase , "status" : response .status_code , "headers" : amazon_headers },
573
+ )
567
574
return response
568
575
569
576
def do_options_request_with_logging (self , url , headers = None ):
@@ -578,8 +585,9 @@ def do_options_request_with_logging(self, url, headers=None):
578
585
"""
579
586
response = requests .options (url , headers = headers ) if headers else requests .options (url )
580
587
amazon_headers = RequestUtils (response ).get_amazon_headers ()
581
- REQUEST_LOGGER .info (
582
- "Request made to " + url ,
583
- extra = {"test" : self .testcase , "status" : response .status_code , "headers" : amazon_headers },
584
- )
588
+ if self .internal :
589
+ REQUEST_LOGGER .info (
590
+ "Request made to " + url ,
591
+ extra = {"test" : self .testcase , "status" : response .status_code , "headers" : amazon_headers },
592
+ )
585
593
return response
0 commit comments