File tree 1 file changed +12
-13
lines changed
1 file changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -426,24 +426,23 @@ def pytest_runtest_setup(item):
426
426
427
427
428
428
def pytest_collection_modifyitems (session , config , items ):
429
- def get_marker_transaction (test ):
430
- marker = test .get_closest_marker ('django_db' )
431
- if marker :
432
- return validate_django_db (marker )[0 ]
433
- return None
429
+ def get_order_number (test ):
430
+ marker_db = test .get_closest_marker ('django_db' )
431
+ if marker_db :
432
+ transaction = validate_django_db (marker_db )[0 ]
434
433
435
- def has_fixture (test , fixture ):
436
- return fixture in getattr (test , 'funcargnames' , [])
434
+ if transaction is True :
435
+ return 1
436
+ else :
437
+ transaction = None
437
438
438
- def get_order_number (test ):
439
- if get_marker_transaction (test ) is True :
440
- return 1
441
- if has_fixture (test , "transactional_db" ):
439
+ fixtures = getattr (test , 'funcargnames' , [])
440
+ if "transactional_db" in fixtures :
442
441
return 1
443
442
444
- if get_marker_transaction ( test ) is False :
443
+ if transaction is False :
445
444
return 0
446
- if has_fixture ( test , "db" ) :
445
+ if "db" in fixtures :
447
446
return 0
448
447
449
448
return 2
You can’t perform that action at this time.
0 commit comments