Skip to content

Commit

Permalink
Add a unit test for the new try-catch clause
Browse files Browse the repository at this point in the history
  • Loading branch information
lidizheng committed Apr 21, 2022
1 parent 304f0b5 commit 327e15b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/transport/test_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ def test_session_closed_on_del(self):
request.__del__()
http.close.assert_called_with()

http = mock.create_autospec(requests.Session, instance=True)
http.close.side_effect = TypeError('test injected TypeError')
request = google.auth.transport.requests.Request(http)
request.__del__()
http.close.assert_called_with()


class TestTimeoutGuard(object):
def make_guard(self, *args, **kwargs):
Expand Down

0 comments on commit 327e15b

Please sign in to comment.