From ce75442f5d4b89cafc8fa59edaf19c8a3192025b Mon Sep 17 00:00:00 2001 From: Oleg Ovcharuk Date: Mon, 30 Mar 2026 13:41:21 +0300 Subject: [PATCH] Bump test requirements --- test-requirements.txt | 55 ++++++------------- tests/conftest.py | 10 +--- .../test_token_exchange.py | 6 +- .../topic_reader_asyncio_test.py | 4 +- 4 files changed, 24 insertions(+), 51 deletions(-) diff --git a/test-requirements.txt b/test-requirements.txt index a5b65963..15785c53 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,48 +1,27 @@ -attrs==21.2.0 -bcrypt==3.2.0 -black==22.12.0 -cached-property==1.5.2 -certifi==2024.7.4 -cffi>=1.17.0,<2.0.0 -charset-normalizer==2.0.1 -cryptography==41.0.0 -distro==1.5.0 +bcrypt>=4.0.0 +black==24.10.0 +cryptography>=41.0.0 docker>=5.0.0 +flake8==7.1.0 +freezegun>=1.3.0 grpcio>=1.42.0 -idna==3.2 -importlib-metadata==4.6.1 -iniconfig==1.1.1 -jsonschema==3.2.0 -packaging==21.0 -paramiko==2.10.1 -pluggy>=1.0.0 +packaging>=23.0 +paramiko>=3.0.0 protobuf>=3.13.0,<7.0.0 -py>=1.11.0 -pycparser==2.20 -PyNaCl==1.4.0 -pyparsing==2.4.7 -pyrsistent==0.18.0 -pytest>=7.0.0,<8.0.0 -pytest-asyncio==0.21.0 +pytest>=7.0.0 +pytest-asyncio>=0.21.0 pytest-docker>=3.0.0 -python-dotenv==0.18.0 -PyYAML==5.3.1 -pyjwt==2.0.0 -requests==2.31.0 -texttable==1.6.4 -toml==0.10.2 -typing-extensions==4.12.2 -urllib3==1.26.6 -websocket-client==0.59.0 -zipp==3.19.1 -aiohttp>=3.9.0 -pytest-pep8 pytest-flake8 -flake8==6.1.0 -sqlalchemy==1.4.26 +pytest-pep8 +python-dotenv>=1.0.0 +PyYAML>=6.0 +pyjwt>=2.4.0 +requests>=2.31.0 +sqlalchemy>=1.4.0,<2.0.0 +typing-extensions>=4.6.0 +aiohttp>=3.9.0 pylint-protobuf cython -freezegun>=1.3.0 # pytest-cov yandexcloud -e . diff --git a/tests/conftest.py b/tests/conftest.py index 9151ede0..02a094cc 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -158,7 +158,7 @@ async def aio_connection(endpoint, database): @pytest.fixture() -async def driver(endpoint, database, event_loop): +async def driver(endpoint, database): driver_config = ydb.DriverConfig( endpoint, database, @@ -173,7 +173,7 @@ async def driver(endpoint, database, event_loop): @pytest.fixture() -async def driver_sync(endpoint, database, event_loop): +async def driver_sync(endpoint, database): driver_config = ydb.DriverConfig( endpoint, database, @@ -261,7 +261,6 @@ def topic_consumer(): @pytest.fixture() -@pytest.mark.asyncio() async def topic_path(driver, topic_consumer, database) -> str: topic_path = database + "/test-topic" @@ -279,7 +278,6 @@ async def topic_path(driver, topic_consumer, database) -> str: @pytest.fixture() -@pytest.mark.asyncio() async def topic2_path(driver, topic_consumer, database) -> str: topic_path = database + "/test-topic2" @@ -297,7 +295,6 @@ async def topic2_path(driver, topic_consumer, database) -> str: @pytest.fixture() -@pytest.mark.asyncio() async def topic_with_two_partitions_path(driver, topic_consumer, database) -> str: topic_path = database + "/test-topic-two-partitions" @@ -317,7 +314,6 @@ async def topic_with_two_partitions_path(driver, topic_consumer, database) -> st @pytest.fixture() -@pytest.mark.asyncio() async def topic_with_messages(driver, topic_consumer, database): topic_path = database + "/test-topic-with-messages" try: @@ -348,7 +344,6 @@ async def topic_with_messages(driver, topic_consumer, database): @pytest.fixture() -@pytest.mark.asyncio() async def topic_with_messages_with_metadata(driver, topic_consumer, database): topic_path = database + "/test-topic-with-messages-with-metadata" try: @@ -373,7 +368,6 @@ async def topic_with_messages_with_metadata(driver, topic_consumer, database): @pytest.fixture() -@pytest.mark.asyncio() async def topic_reader(driver, topic_consumer, topic_path) -> ydb.TopicReaderAsyncIO: reader = driver.topic_client.reader(topic=topic_path, consumer=topic_consumer) yield reader diff --git a/tests/oauth2_token_exchange/test_token_exchange.py b/tests/oauth2_token_exchange/test_token_exchange.py index 51270ba1..52dcbd46 100644 --- a/tests/oauth2_token_exchange/test_token_exchange.py +++ b/tests/oauth2_token_exchange/test_token_exchange.py @@ -629,7 +629,7 @@ def test_oauth2_token_exchange_credentials_file(): }, }, http_request_is_expected=False, - get_token_error_text_part="Could not deserialize key data.", + get_token_error_text_part="Could not parse the provided public key.", ), DataForConfigTest( cfg={ @@ -640,7 +640,7 @@ def test_oauth2_token_exchange_credentials_file(): }, }, http_request_is_expected=False, - get_token_error_text_part="Could not deserialize key data.", + get_token_error_text_part="Unable to load PEM file", ), DataForConfigTest( cfg={ @@ -651,7 +651,7 @@ def test_oauth2_token_exchange_credentials_file(): }, }, http_request_is_expected=False, - get_token_error_text_part="sign() missing 1 required positional argument", + get_token_error_text_part="Invalid Key type for ECAlgorithm", ), DataForConfigTest( cfg_file="~/unknown-file.cfg", diff --git a/ydb/_topic_reader/topic_reader_asyncio_test.py b/ydb/_topic_reader/topic_reader_asyncio_test.py index 371aee50..664cd8e4 100644 --- a/ydb/_topic_reader/topic_reader_asyncio_test.py +++ b/ydb/_topic_reader/topic_reader_asyncio_test.py @@ -40,11 +40,11 @@ @pytest.fixture(autouse=True) -def handle_exceptions(event_loop): +async def handle_exceptions(): def handler(loop, context): print(context) - event_loop.set_exception_handler(handler) + asyncio.get_running_loop().set_exception_handler(handler) @pytest.fixture()