Skip to content

Commit aeb3bda

Browse files
committed
Move handling of 'live_server' from _django_db_fixture_helper to db
This makes it a bit clearer that `live_server` auto-uses `transactional_db`.
1 parent 619fd87 commit aeb3bda

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pytest_django/fixtures.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ def flushdb():
8383
request.addfinalizer(_django_cursor_wrapper.disable)
8484
request.addfinalizer(flushdb)
8585
else:
86-
if 'live_server' in request.funcargnames:
87-
return
8886
from django.test import TestCase
8987

9088
_django_cursor_wrapper.enable()
@@ -158,7 +156,8 @@ def db(request, _django_db_setup, _django_cursor_wrapper):
158156
database setup will behave as only ``transactional_db`` was
159157
requested.
160158
"""
161-
if 'transactional_db' in request.funcargnames:
159+
if 'transactional_db' in request.funcargnames \
160+
or 'live_server' in request.funcargnames:
162161
return request.getfuncargvalue('transactional_db')
163162
return _django_db_fixture_helper(False, request, _django_cursor_wrapper)
164163

0 commit comments

Comments
 (0)