Skip to content

Spatialite backed test databases are not allowed to be :memory: based #477

Open
@poligarcia

Description

@poligarcia

On my test settings I have this DATABASES config:

DATABASES = {
    'default': {
        'ENGINE': 'django.contrib.gis.db.backends.spatialite',
        'NAME': ':memory:',
    }
}

As I'm not using exactly sqlite as engine, pytest-django renames my DB by preppending test_, while I want to use ":memory:". This causes the tear-down to fail, as sqlite/spatialite wants to delete the db file.

I managed to go around this issue by overriding the django_db_modify_db_settings_xdist_suffix fixture to allow using :memory: for spatialite.

Having said that... I'm not 100% sure I can use :memory: with spatialite.

Django==1.10
pytest==3.0.3
pytest-django==3.0.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions