Skip to content

Commit

Permalink
Merge pull request #155 from lsst-sqre/tickets/DM-45137
Browse files Browse the repository at this point in the history
DM-45137: Stop importing from _pytest
  • Loading branch information
rra authored Jul 5, 2024
2 parents a0a3b42 + 8c05bf0 commit 40dbf88
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
7 changes: 3 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import boto3
import pytest
import pytest_asyncio
from _pytest.monkeypatch import MonkeyPatch
from asgi_lifespan import LifespanManager
from fastapi import FastAPI
from httpx import ASGITransport, AsyncClient
Expand All @@ -24,7 +23,7 @@


@pytest_asyncio.fixture
async def app(monkeypatch: MonkeyPatch) -> AsyncIterator[FastAPI]:
async def app(monkeypatch: pytest.MonkeyPatch) -> AsyncIterator[FastAPI]:
"""Return a configured test application.
Wraps the application in a lifespan manager so that startup and shutdown
Expand Down Expand Up @@ -60,7 +59,7 @@ def mock_butler() -> Iterator[MockButler]:


@pytest.fixture
def s3(monkeypatch: MonkeyPatch) -> Iterator[boto3.client]:
def s3(monkeypatch: pytest.MonkeyPatch) -> Iterator[boto3.client]:
"""Mock out S3 for testing."""
monkeypatch.setenv("AWS_ACCESS_KEY_ID", "testing")
monkeypatch.setenv("AWS_DEFAULT_REGION", "us-east-1")
Expand All @@ -81,7 +80,7 @@ def s3(monkeypatch: MonkeyPatch) -> Iterator[boto3.client]:

@pytest.fixture
def mock_google_storage(
monkeypatch: MonkeyPatch,
monkeypatch: pytest.MonkeyPatch,
) -> Iterator[MockStorageClient]:
"""Mock out the Google Cloud Storage API."""
monkeypatch.setattr(config, "storage_backend", StorageBackend.GCS)
Expand Down
5 changes: 3 additions & 2 deletions tests/handlers/hips_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import pytest
import respx
from _pytest.monkeypatch import MonkeyPatch
from httpx import AsyncClient, Response
from pydantic import HttpUrl

Expand All @@ -17,7 +16,9 @@

@pytest.mark.asyncio
async def test_hips_list(
client: AsyncClient, respx_mock: respx.Router, monkeypatch: MonkeyPatch
client: AsyncClient,
respx_mock: respx.Router,
monkeypatch: pytest.MonkeyPatch,
) -> None:
hips_list_template = (
Path(__file__).parent.parent / "data" / "hips-properties"
Expand Down

0 comments on commit 40dbf88

Please sign in to comment.