From ea171f2034e99c92415ea6642791a4deded12725 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Thu, 30 May 2019 21:05:37 +0200 Subject: [PATCH] tests: follow-up fix for test_sqlite_database_renamed Ref: https://github.com/pytest-dev/pytest-django/issues/712#issuecomment-497440920 --- .travis.yml | 2 +- tests/test_db_setup.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9011cf891..c3f02d3fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ jobs: python: 3.7 env: TOXENV=py37-dj21-sqlite-coverage - python: 3.7 - env: TOXENV=py37-dj22-sqlite-coverage + env: TOXENV=py37-dj22-sqlite-xdist-coverage # Explicitly test (older) pytest 4.1. - python: 3.7 diff --git a/tests/test_db_setup.py b/tests/test_db_setup.py index cc8353c08..0b3d516e0 100644 --- a/tests/test_db_setup.py +++ b/tests/test_db_setup.py @@ -278,7 +278,10 @@ def test_a(): assert conn_default.vendor == 'sqlite' db_name = conn_default.creation._get_test_db_name() - if conn_default.features.can_share_in_memory_db: + + # can_share_in_memory_db was removed in Django 2.1, and + # used in _get_test_db_name before. + if getattr(conn_default.features, "can_share_in_memory_db", True): assert 'file:memorydb' in db_name else: assert db_name == ":memory:"