tortoise / tortoise/tortoise-orm
#Question How to setup tortoise for Sanic application in pytest?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5.6k
- Forks
- 516
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 9
Description
Im trying to use sanic-testing but when i try to make Tortoise.init() for my test db (e.g. sqlite:///:memory) in listener or other fixture i have exceptions.
How can i setup tortoise orm for sanic app to make it work and test my crud application? (fixture with scope='session', autouser=True didnt work)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing Tortoise.init() with sanic-testing, an in-memory SQLite database, and the listener or fixture setup described in the issue. Use the resulting exceptions to investigate a working pytest fixture for the Sanic CRUD application; done means the test database initializes and CRUD tests run successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, sqlite
- Domain
- backend, databases, testing
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100