From 586ab7c00c5e6ef13561aadf94cb0140715c4076 Mon Sep 17 00:00:00 2001 From: James Braza Date: Fri, 13 Sep 2024 11:27:59 -0700 Subject: [PATCH] Removed `monkeypatch` fixture since it's not a dependency (#395) --- tests/test_clients.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/test_clients.py b/tests/test_clients.py index 6d814c72..f389b802 100644 --- a/tests/test_clients.py +++ b/tests/test_clients.py @@ -3,6 +3,7 @@ import logging from collections.abc import Collection, Sequence from typing import Any, cast +from unittest.mock import patch import aiohttp import pytest @@ -473,13 +474,11 @@ async def test_odd_client_requests() -> None: @pytest.mark.asyncio -async def test_ensure_robust_to_timeouts(monkeypatch) -> None: - # 0.15 should be short enough to not get a response in time. - monkeypatch.setattr(paperqa.clients.crossref, "CROSSREF_API_REQUEST_TIMEOUT", 0.05) - monkeypatch.setattr( - paperqa.clients.semantic_scholar, "SEMANTIC_SCHOLAR_API_REQUEST_TIMEOUT", 0.05 - ) - +@patch.object(paperqa.clients.crossref, "CROSSREF_API_REQUEST_TIMEOUT", 0.05) +@patch.object( + paperqa.clients.semantic_scholar, "SEMANTIC_SCHOLAR_API_REQUEST_TIMEOUT", 0.05 +) +async def test_ensure_robust_to_timeouts() -> None: async with aiohttp.ClientSession() as session: client = DocMetadataClient(session) details = await client.query(