From ae1c4c3cb2815f3c2a03f2707f7e16e6bc00bb10 Mon Sep 17 00:00:00 2001 From: David Schultz Date: Mon, 2 Dec 2024 12:45:09 -0600 Subject: [PATCH] workaround for httpx 0.28 mocker bug --- tests/credentials/test_service.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/credentials/test_service.py b/tests/credentials/test_service.py index 997c0350..9f971180 100644 --- a/tests/credentials/test_service.py +++ b/tests/credentials/test_service.py @@ -3,6 +3,7 @@ from unittest.mock import MagicMock import motor.motor_asyncio import jwt +import pytest import iceprod.credentials.service @@ -40,6 +41,7 @@ async def test_credentials_service_refresh_empty(mongo_url, mongo_clear, respx_m await rs._run_once() +@pytest.mark.respx(using="httpx", assert_all_called=False) async def test_credentials_service_refresh_not_exp(mongo_url, mongo_clear, respx_mock): db = motor.motor_asyncio.AsyncIOMotorClient(mongo_url)['creds'] clients = '{}' @@ -66,6 +68,7 @@ async def test_credentials_service_refresh_not_exp(mongo_url, mongo_clear, respx assert rs.last_success_time is not None +@pytest.mark.respx(using="httpx") async def test_credentials_service_refresh_group(mongo_url, mongo_clear, respx_mock, monkeypatch): db = motor.motor_asyncio.AsyncIOMotorClient(mongo_url)['creds'] clients = json.dumps({ @@ -103,6 +106,7 @@ async def test_credentials_service_refresh_group(mongo_url, mongo_clear, respx_m assert ret['expiration'] == now+1000 +@pytest.mark.respx(using="httpx") async def test_credentials_service_refresh_user(mongo_url, mongo_clear, respx_mock, monkeypatch): db = motor.motor_asyncio.AsyncIOMotorClient(mongo_url)['creds'] clients = json.dumps({