@@ -33,7 +33,9 @@ def test_db_order(django_testdir):
33
33
"""Test order in which tests are being executed."""
34
34
35
35
django_testdir .create_test_module ('''
36
+ from unittest import TestCase
36
37
import pytest
38
+ from django.test import SimpleTestCase, TestCase as DjangoTestCase, TransactionTestCase
37
39
38
40
from .app.models import Item
39
41
@@ -50,14 +52,34 @@ def test_run_first_fixture(db):
50
52
@pytest.mark.django_db
51
53
def test_run_first_decorator():
52
54
pass
55
+
56
+ class MyTestCase(TestCase):
57
+ def test_run_last_test_case(self):
58
+ pass
59
+
60
+ class MySimpleTestCase(SimpleTestCase):
61
+ def test_run_last_simple_test_case(self):
62
+ pass
63
+
64
+ class MyDjangoTestCase(DjangoTestCase):
65
+ def test_run_first_django_test_case(self):
66
+ pass
67
+
68
+ class MyTransactionTestCase(TransactionTestCase):
69
+ def test_run_second_transaction_test_case(self):
70
+ pass
53
71
''' )
54
72
result = django_testdir .runpytest_subprocess ('-v' , '-s' )
55
73
assert result .ret == 0
56
74
result .stdout .fnmatch_lines ([
57
75
"*test_run_first_fixture*" ,
58
76
"*test_run_first_decorator*" ,
77
+ "*test_run_first_django_test_case*" ,
59
78
"*test_run_second_decorator*" ,
60
79
"*test_run_second_fixture*" ,
80
+ "*test_run_second_transaction_test_case*" ,
81
+ "*test_run_last_test_case*" ,
82
+ "*test_run_last_simple_test_case*" ,
61
83
])
62
84
63
85
0 commit comments