pytest-dev / pytest-dev/pytest-django
Raise warning when using SQLite3 in-memory test database with --reuse-db
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 367
- PR merge metrics
- No merged PRs in 30d
Description
Currently I've running several unittests with py.test that needs a database. The tests working fine.
But I#ve running with --reuse-dband the following database settings:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'db.sqlite3'
}
}
The Tests will work fine, but the databse db.sqlite3 won't getting created / the file is missing while the tests run / after the tests.
I use django unittests and run py.test with the following: py.test -v -s --ds=envisia.test.settings --reuse-db also I'm running on Python 3.4.1, pytest 2.6.1 and Django 1.7rc2.
On PostgreSQL the database will be created and will exists..
Edit: Also PostgreSQL tests run faster even when I run sqlite3 on :memory: which is somehow strange?! But I think that's cause of PostgreSQL --reuse-db works.
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
Reproduce the issue with the shown SQLite settings and py.test -v -s --ds=envisia.test.settings --reuse-db command, then trace the plugin's handling of SQLite and --reuse-db. Done means the incompatible in-memory or file-backed behavior is detected and a clear warning is raised; add or update a regression test for that case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- database, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100