Skip to content

Commit 39c8dcc

Browse files
committed
plugin: add a note why we reorder tests
1 parent 1830acd commit 39c8dcc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pytest_django/plugin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,9 @@ def pytest_collection_modifyitems(items: list[pytest.Item]) -> None:
445445

446446
from django.test import TestCase, TransactionTestCase
447447

448+
# Reorder the tests as Django does:
449+
# https://docs.djangoproject.com/en/6.0/topics/testing/overview/#order-in-which-tests-are-executed
450+
448451
def get_order_number(test: pytest.Item) -> int:
449452
test_cls = getattr(test, "cls", None)
450453
if test_cls and issubclass(test_cls, TransactionTestCase):

0 commit comments

Comments
 (0)