Skip to content

Commit ef75a04

Browse files
committed
Fix --reuse-db and --create-db not working together. Fixes #411
1 parent 94cccb9 commit ef75a04

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

pytest_django/fixtures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def teardown_database():
9999
verbosity=pytest.config.option.verbose,
100100
)
101101

102-
if not django_db_keepdb:
102+
if not request.config.getvalue('reuse_db'):
103103
request.addfinalizer(teardown_database)
104104

105105

tests/test_db_setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ def test_db_can_be_accessed():
7575
])
7676

7777
# Make sure the database has been re-created and the mark is gone
78+
assert db_exists()
7879
assert not mark_exists()
7980

8081

0 commit comments

Comments
 (0)