Skip to content

Commit 8bd4163

Browse files
Update segment/analytics/test/test_request.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent e4f34d0 commit 8bd4163

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

segment/analytics/test/test_request.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,14 +191,12 @@ def mock_post_fn(*args, **kwargs):
191191
return res
192192

193193
with mock.patch('segment.analytics.request._session.post', side_effect=mock_post_fn):
194-
try:
194+
with self.assertRaises(APIError):
195195
post('testsecret', oauth_manager=oauth_manager, batch=[{
196196
'userId': 'userId',
197197
'event': 'python event',
198198
'type': 'track'
199199
}])
200-
except APIError:
201-
pass
202200

203201
# Verify clear_token was called
204202
oauth_manager.clear_token.assert_called_once()

0 commit comments

Comments
 (0)