From ce7cf3601d39e137a72b5ba365bfc9ddcb2b0cea Mon Sep 17 00:00:00 2001 From: karel rehor Date: Mon, 13 Jul 2026 16:39:36 +0200 Subject: [PATCH 1/3] chore: fix aioresponses library to 0.7.3 only --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 76c2748c..053c1697 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ 'pytest-timeout>=2.1.0', 'httpretty==1.0.5', 'psutil>=5.6.3', - 'aioresponses>=0.7.3', + 'aioresponses==0.7.3', 'sphinx==1.8.5', 'sphinx_rtd_theme', 'jinja2>=3.1.4' From fed21bc311ef13de9d2ecb559a178d5008ecb68d Mon Sep 17 00:00:00 2001 From: karel rehor Date: Mon, 13 Jul 2026 16:57:27 +0200 Subject: [PATCH 2/3] chore: update codecov key - troubleshoot. --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a47bde06..e4bdcc36 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -68,7 +68,7 @@ jobs: curl -Os https://uploader.codecov.io/latest/linux/codecov curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig - curl -s https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import + curl -fsSL https://uploader.codecov.io/verification.gpg | gpg --no-default-keyring --keyring trustedkeys.gpg --import gpgv codecov.SHA256SUM.sig codecov.SHA256SUM shasum -a 256 -c codecov.SHA256SUM chmod +x ./codecov From 0d88a882f8031cdaa4d95e602a5f6b57b4b136a5 Mon Sep 17 00:00:00 2001 From: karel rehor Date: Tue, 14 Jul 2026 13:23:18 +0200 Subject: [PATCH 3/3] chore: set conditional include for tests using aioresponses. --- tests/test_InfluxDBClientAsync.py | 69 +++++++++++++++++-------------- 1 file changed, 39 insertions(+), 30 deletions(-) diff --git a/tests/test_InfluxDBClientAsync.py b/tests/test_InfluxDBClientAsync.py index cb0586b9..b9c2c315 100644 --- a/tests/test_InfluxDBClientAsync.py +++ b/tests/test_InfluxDBClientAsync.py @@ -1,4 +1,6 @@ import asyncio +import sys + import dateutil.parser import logging import math @@ -12,7 +14,10 @@ import pandas import pytest import warnings -from aioresponses import aioresponses + +if sys.version_info < (3, 10): + from aioresponses import aioresponses + from influxdb_client import Point, WritePrecision, BucketsService, OrganizationsService, Organizations from influxdb_client.client.exceptions import InfluxDBError @@ -429,13 +434,15 @@ async def test_username_password_authorization(self): debug=True) await self.client.query_api().query("buckets()", "my-org") - @async_test - @aioresponses() - async def test_init_without_token(self, mocked): - mocked.post('http://localhost/api/v2/query?org=my-org', status=200, body='') - await self.client.close() - self.client = InfluxDBClientAsync("http://localhost") - await self.client.query_api().query("buckets()", "my-org") + + if sys.version_info < (3, 10): + @async_test + @aioresponses() + async def test_init_without_token(self, mocked): + mocked.post('http://localhost/api/v2/query?org=my-org', status=200, body='') + await self.client.close() + self.client = InfluxDBClientAsync("http://localhost") + await self.client.query_api().query("buckets()", "my-org") @async_test async def test_redacted_auth_header(self): @@ -465,12 +472,13 @@ async def test_query_and_debug(self): results = await buckets_service.get_buckets_async() self.assertIn("my-bucket", list(map(lambda bucket: bucket.name, results.buckets))) - @async_test - @aioresponses() - async def test_parse_csv_with_new_lines_in_column(self, mocked): - await self.client.close() - self.client = InfluxDBClientAsync("http://localhost") - mocked.post('http://localhost/api/v2/query?org=my-org', status=200, body='''#datatype,string,long,dateTime:RFC3339 + if sys.version_info < (3, 10): + @async_test + @aioresponses() + async def test_parse_csv_with_new_lines_in_column(self, mocked): + await self.client.close() + self.client = InfluxDBClientAsync("http://localhost") + mocked.post('http://localhost/api/v2/query?org=my-org', status=200, body='''#datatype,string,long,dateTime:RFC3339 #group,false,false,false #default,_result,, ,result,table,_time @@ -499,13 +507,13 @@ async def test_parse_csv_with_new_lines_in_column(self, mocked): ,,1,profiler/operator,*universe.schemaMutationTransformation,keep2,4,1875,42042,64209,16052.25 ,,1,profiler/operator,*universe.limitTransformation,limit3,3,1333,38750,47874,15958''') - records = [] - await self.client\ - .query_api(QueryOptions(profilers=["operator", "query"], + records = [] + await self.client\ + .query_api(QueryOptions(profilers=["operator", "query"], profiler_callback=lambda record: records.append(record))) \ - .query("buckets()", "my-org") + .query("buckets()", "my-org") - self.assertEqual(4, len(records)) + self.assertEqual(4, len(records)) @async_test async def test_query_exception_propagation(self): @@ -534,24 +542,25 @@ async def test_write_exception_propagation(self): self.assertTrue(re.compile("^v.*").match(headers.get("X-Influxdb-Version"))) self.assertEqual("OSS", headers.get("X-Influxdb-Build")) - @async_test - @aioresponses() - async def test_parse_utf8_two_bytes_character(self, mocked): - await self.client.close() - self.client = InfluxDBClientAsync("http://localhost") + if sys.version_info < (3, 10): + @async_test + @aioresponses() + async def test_parse_utf8_two_bytes_character(self, mocked): + await self.client.close() + self.client = InfluxDBClientAsync("http://localhost") - body = '''#group,false,false,false,false,true,true,true + body = '''#group,false,false,false,false,true,true,true #datatype,string,long,dateTime:RFC3339,string,string,string,string #default,_result,,,,,, ,result,table,_time,_value,_field,_measurement,type ''' - for i in range(1000): - body += f",,0,2022-10-13T12:28:31.{i}Z,ÂÂÂ,value,async,error\n" + for i in range(1000): + body += f",,0,2022-10-13T12:28:31.{i}Z,ÂÂÂ,value,async,error\n" - mocked.post('http://localhost/api/v2/query?org=my-org', status=200, body=body) + mocked.post('http://localhost/api/v2/query?org=my-org', status=200, body=body) - data_frame = await self.client.query_api().query_data_frame("from()", "my-org") - self.assertEqual(1000, len(data_frame)) + data_frame = await self.client.query_api().query_data_frame("from()", "my-org") + self.assertEqual(1000, len(data_frame)) @async_test async def test_management_apis(self):