Skip to content

Commit 49c158a

Browse files
author
beyondgeeks
committed
tests: fix test_sqlite_database_renamed for Django 1.11 (#739)
* tests: fix test_sqlite_database_renamed for Django 1.11 Ref: https://github.com/django/django/blob/1.11.20/django/db/backends/sqlite3/creation.py#L19 Fixes pytest-dev/pytest-django#712. * ci: Travis: test py27-dj111-sqlite-xdist
1 parent 2516c39 commit 49c158a

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ jobs:
1010
services:
1111
- postgresql
1212
- python: 3.6
13-
env: TOXENV=py36-dj111-sqlite-coverage
14-
- python: 2.7
15-
env: TOXENV=py27-dj111-mysql_innodb-coverage
13+
env: TOXENV=py36-dj111-mysql_innodb-coverage
1614
services:
1715
- mysql
16+
- python: 2.7
17+
env: TOXENV=py27-dj111-sqlite-xdist-coverage
1818
- python: 3.6
1919
env: TOXENV=checkqa,docs
2020

tests/test_db_setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,10 @@ def test_a():
278278
279279
assert conn_default.vendor == 'sqlite'
280280
db_name = conn_default.creation._get_test_db_name()
281-
assert 'file:memorydb' in db_name
281+
if conn_default.features.can_share_in_memory_db:
282+
assert 'file:memorydb' in db_name
283+
else:
284+
assert db_name == ":memory:"
282285
283286
assert conn_db2.vendor == 'sqlite'
284287
db_name = conn_db2.creation._get_test_db_name()

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ deps =
1919
dj19: Django>=1.9,<1.10
2020
dj18: Django>=1.8,<1.9
2121

22-
mysql_myisam: mysql-python==1.2.5
23-
mysql_innodb: mysql-python==1.2.5
22+
mysql_myisam: mysqlclient==1.4.2.post1
23+
mysql_innodb: mysqlclient==1.4.2.post1
2424

2525
postgres: psycopg2-binary
2626
coverage: coverage-enable-subprocess

0 commit comments

Comments
 (0)