Skip to content

Removed monkeypatch fixture since it's not a dependency #395

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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