@@ -100,6 +100,7 @@ def test_basic_super_properties(self):
100100 self .assertEqual (msg ["properties" ]["source" ], "repo-name" )
101101
102102 def test_basic_capture_exception (self ):
103+
103104 with mock .patch .object (Client , "capture" , return_value = None ) as patch_capture :
104105 client = self .client
105106 exception = Exception ("test exception" )
@@ -127,6 +128,7 @@ def test_basic_capture_exception(self):
127128 )
128129
129130 def test_basic_capture_exception_with_distinct_id (self ):
131+
130132 with mock .patch .object (Client , "capture" , return_value = None ) as patch_capture :
131133 client = self .client
132134 exception = Exception ("test exception" )
@@ -154,6 +156,7 @@ def test_basic_capture_exception_with_distinct_id(self):
154156 )
155157
156158 def test_basic_capture_exception_with_correct_host_generation (self ):
159+
157160 with mock .patch .object (Client , "capture" , return_value = None ) as patch_capture :
158161 client = Client (FAKE_TEST_API_KEY , on_error = self .set_fail , host = "https://aloha.com" )
159162 exception = Exception ("test exception" )
@@ -181,6 +184,7 @@ def test_basic_capture_exception_with_correct_host_generation(self):
181184 )
182185
183186 def test_basic_capture_exception_with_correct_host_generation_for_server_hosts (self ):
187+
184188 with mock .patch .object (Client , "capture" , return_value = None ) as patch_capture :
185189 client = Client (FAKE_TEST_API_KEY , on_error = self .set_fail , host = "https://app.posthog.com" )
186190 exception = Exception ("test exception" )
@@ -208,6 +212,7 @@ def test_basic_capture_exception_with_correct_host_generation_for_server_hosts(s
208212 )
209213
210214 def test_basic_capture_exception_with_no_exception_given (self ):
215+
211216 with mock .patch .object (Client , "capture" , return_value = None ) as patch_capture :
212217 client = self .client
213218 try :
@@ -244,8 +249,10 @@ def test_basic_capture_exception_with_no_exception_given(self):
244249 self .assertEqual (capture_call [2 ]["$exception_list" ][0 ]["stacktrace" ]["frames" ][0 ]["in_app" ], True )
245250
246251 def test_basic_capture_exception_with_no_exception_happening (self ):
252+
247253 with mock .patch .object (Client , "capture" , return_value = None ) as patch_capture :
248254 with self .assertLogs ("posthog" , level = "WARNING" ) as logs :
255+
249256 client = self .client
250257 client .capture_exception ()
251258
0 commit comments