Overview
Introduce pytest with pytest-asyncio as the project's testing foundation, along with a GitHub Actions workflow that runs tests on PRs. This gives contributors a
structured way to verify behavior without a live bot and catches regressions before they merge.
Technical Requirements
Acceptance Criteria
Notes
BOT_MODE=TEST can be set in the CI environment without a real token since nothing connects to Discord. Use unittest.mock.AsyncMock for Motor and Discord async
interfaces.
Branch
Overview
Introduce
pytestwithpytest-asyncioas the project's testing foundation, along with a GitHub Actions workflow that runs tests on PRs. This gives contributors astructured way to verify behavior without a live bot and catches regressions before they merge.
Technical Requirements
pytestandpytest-asyncioas dev dependencies (requirements-dev.txtor extras)tests/conftest.pywith shared mock fixtures for bot instance (discord.ext.commands.Bot), MongoDB/Motor collections, and Discord context/interactionobjects
.github/workflows/tests.ymlthat triggers on PRs todevandmain, runspytestwith no real secrets required, and runs in parallel with the existingRuff workflow
Acceptance Criteria
pytestandpytest-asyncioare installed and configured (pyproject.tomlorpytest.ini)tests/conftest.pyprovides reusable fixtures for bot, MongoDB, and Discord contextpyteston every PR withoutDISCORD_TOKENorMONGO_URINotes
BOT_MODE=TESTcan be set in the CI environment without a real token since nothing connects to Discord. Useunittest.mock.AsyncMockfor Motor and Discord asyncinterfaces.
Branch