Skip to content

Commit

Permalink
Removed monkeypatch fixture since it's not a dependency (#395)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbraza authored Sep 13, 2024
1 parent 870e2f6 commit 586ab7c
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions tests/test_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 586ab7c

Please sign in to comment.