From 74f008666464a1905cae50cc9bbfd1fc4468b241 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Sat, 18 Apr 2026 13:07:20 -0400 Subject: [PATCH] test: bootstrap backend pytest infrastructure with sanity tests --- backend/pytest.ini | 6 ++++++ backend/requirements.txt | 1 + backend/tests/__init__.py | 0 backend/tests/conftest.py | 8 ++++++++ backend/tests/test_sanity.py | 12 ++++++++++++ 5 files changed, 27 insertions(+) create mode 100644 backend/pytest.ini create mode 100644 backend/tests/__init__.py create mode 100644 backend/tests/conftest.py create mode 100644 backend/tests/test_sanity.py diff --git a/backend/pytest.ini b/backend/pytest.ini new file mode 100644 index 0000000..56174e6 --- /dev/null +++ b/backend/pytest.ini @@ -0,0 +1,6 @@ +[pytest] +testpaths = tests +asyncio_mode = auto +pythonpath = . +filterwarnings = + ignore::DeprecationWarning:celery.* diff --git a/backend/requirements.txt b/backend/requirements.txt index f2153d5..a26ec2a 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -26,3 +26,4 @@ gallery-dl>=1.31.10 # Testing pytest pytest-asyncio +aioresponses diff --git a/backend/tests/__init__.py b/backend/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/tests/conftest.py b/backend/tests/conftest.py new file mode 100644 index 0000000..e8f499c --- /dev/null +++ b/backend/tests/conftest.py @@ -0,0 +1,8 @@ +"""Shared pytest fixtures for backend tests.""" +import asyncio +import pytest + + +@pytest.fixture +def anyio_backend(): + return "asyncio" diff --git a/backend/tests/test_sanity.py b/backend/tests/test_sanity.py new file mode 100644 index 0000000..01d1dfd --- /dev/null +++ b/backend/tests/test_sanity.py @@ -0,0 +1,12 @@ +"""Sanity test to verify pytest infrastructure works.""" +import asyncio +import pytest + + +def test_sync_sanity(): + assert 1 + 1 == 2 + + +async def test_async_sanity(): + await asyncio.sleep(0) + assert True