matrix-org / matrix-org/synapse-module-cookiecutter-template
Include a mock store in tests
- Dominant language
- Python
- Stars
- 8
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
Tests might need to run their own SQL. To do this, some modules implement a mock store that runs against an in-memory database - see https://github.com/vector-im/tchap-red-list/blob/ce6fbbbcbf3b5a9aa5504ce362ded2203a6f5b5e/tests/__init__.py#L27-L81 for an example. The template should probably include this in the test suite it generates.
Contributor guide
Research direction
Start with the referenced tests/__init__.py example, especially lines 27-81, and compare it with the test suite generated by the template. Add equivalent mock-store coverage for running SQL against an in-memory database, then verify that newly generated module tests include it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, sql
- Domain
- databases, testing
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100