Add pytest config and conftest for test discovery

This commit is contained in:
Adam Moussa 2026-05-29 14:30:44 -04:00
parent 54ef5400b1
commit dcbb0606e6
2 changed files with 16 additions and 0 deletions

3
pyproject.toml Normal file
View file

@ -0,0 +1,3 @@
[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["lambdas/classifier", "lambdas/slack_post", "cdk"]

13
tests/conftest.py Normal file
View file

@ -0,0 +1,13 @@
"""Central test configuration.
Sets dummy environment variables at import time so modules that read
``os.environ`` at module load (slackio, interactions, handler) can be imported
without real AWS credentials. Real values are monkeypatched per-test where
needed.
"""
import os
os.environ.setdefault("SLACK_SECRET_NAME", "test-slack-secret")
os.environ.setdefault("DASHBOARD_URL_PARAM", "/test/dashboard-url")
os.environ.setdefault("ANALYTICS_BUCKET", "test-bucket")