Skip to content

Commit 20bf80b

Browse files
committed
fixup! Run tests in the same order as Django
1 parent 76b10f1 commit 20bf80b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

pytest_django/plugin.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -354,15 +354,13 @@ def pytest_runtest_setup(item):
354354

355355
def pytest_collection_modifyitems(session, config, items):
356356
def get_marker_transaction(test):
357-
marker = test.get_marker("django_db")
357+
marker = test.get_closest_marker('django_db')
358358
if marker:
359-
validate_django_db(marker)
360-
return marker.transaction
359+
return validate_django_db(marker)[0]
361360
return None
362361

363362
def has_fixture(test, fixture):
364-
funcargnames = getattr(test, 'funcargnames', None)
365-
return funcargnames and fixture in funcargnames
363+
return fixture in getattr(test, 'funcargnames', [])
366364

367365
def get_order_number(test):
368366
if get_marker_transaction(test) is True:

0 commit comments

Comments
 (0)