Skip to content

fix(httpx): check if mount transport is None before wrap #3022

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Nov 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
skip none in test too
Signed-off-by: emdneto <[email protected]>
  • Loading branch information
emdneto committed Nov 18, 2024
commit 4574a4955780b343755a7642f41eed06d10e9433
Original file line number Diff line number Diff line change
Expand Up @@ -766,14 +766,14 @@ def assert_proxy_mounts(self, mounts, num_mounts, transport_type=None):
self.assertEqual(len(mounts), num_mounts)
for transport in mounts:
with self.subTest(transport):
if transport is None:
continue
if transport_type:
self.assertIsInstance(
transport,
transport_type,
)
else:
if transport is None:
continue
handler = self.get_transport_handler(transport)
self.assertTrue(
isinstance(handler, ObjectProxy)
Expand Down Expand Up @@ -1017,7 +1017,7 @@ def test_instrument_client_with_no_proxy(self):
self.assert_proxy_mounts(
client._mounts.values(),
3,
(httpx.HTTPTransport, httpx.AsyncHTTPTransport, type(None)),
(httpx.HTTPTransport, httpx.AsyncHTTPTransport),
)
HTTPXClientInstrumentor.instrument_client(client)
result = self.perform_request(self.URL, client=client)
Expand Down