Skip to content

Commit d084213

Browse files
committed
fix: async client always use HTTP_PROXY/HTTPS_PROXY environment variables
1 parent aba8ec8 commit d084213

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

influxdb_client/_async/rest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ def __init__(self, configuration, pools_size=4, maxsize=None, **kwargs):
126126
_client_session_kwargs = kwargs.get('client_session_kwargs', {})
127127
self.pool_manager = _client_session_type(
128128
connector=connector,
129-
trust_env=True,
130129
timeout=timeout,
131130
trace_configs=[trace_config] if configuration.debug else None,
132131
**_client_session_kwargs

tests/test_InfluxDBClientAsync.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,15 @@ async def test_management_apis(self):
414414
self.assertIsInstance(results, Organizations)
415415
self.assertIn("my-org", list(map(lambda org: org.name, results.orgs)))
416416

417+
@async_test
418+
async def test_trust_env_default(self):
419+
self.assertFalse(self.client.api_client.rest_client.pool_manager.trust_env)
420+
421+
await self.client.close()
422+
self.client = InfluxDBClientAsync(url="http://localhost:8086", token="wrong", org="my-org",
423+
client_session_kwargs={'trust_env': True})
424+
self.assertTrue(self.client.api_client.rest_client.pool_manager.trust_env)
425+
417426
async def _prepare_data(self, measurement: str):
418427
_point1 = Point(measurement).tag("location", "Prague").field("temperature", 25.3)
419428
_point2 = Point(measurement).tag("location", "New York").field("temperature", 24.3)

0 commit comments

Comments
 (0)