summaryrefslogtreecommitdiff
path: root/django/test
diff options
context:
space:
mode:
authorromgar <romain.garrigues.cs@gmail.com>2018-11-19 23:15:20 +0000
committerTim Graham <timograham@gmail.com>2018-11-29 11:20:27 -0500
commit9fa0d3786febf36c87ef059a39115aa1ce3326e8 (patch)
tree3fe53c9a0011ed94dc6b235690f4b3d8c4371d2c /django/test
parent7d1123e5ada60963ba3c708a8932e57342278706 (diff)
Refs #25251 -- Filtered out skipped tests when processing the test suite to set _next_serialized_rollback.
Diffstat (limited to 'django/test')
-rw-r--r--django/test/runner.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/django/test/runner.py b/django/test/runner.py
index aa2b269fab..7dc28587af 100644
--- a/django/test/runner.py
+++ b/django/test/runner.py
@@ -646,7 +646,12 @@ def reorder_postprocess(reordered_suite):
If the next test has no serialized_rollback attribute, it means there
aren't any more TransactionTestCases.
"""
- for previous_test, next_test in zip(reordered_suite._tests[:-1], reordered_suite._tests[1:]):
+ # Filter out skipped tests.
+ active_tests = [
+ test for test in reordered_suite._tests
+ if not getattr(test, '__unittest_skip__', False)
+ ]
+ for previous_test, next_test in zip(active_tests[:-1], active_tests[1:]):
next_serialized_rollback = getattr(next_test, 'serialized_rollback', None)
if next_serialized_rollback is not None:
previous_test._next_serialized_rollback = next_serialized_rollback