1
0
mirror of https://github.com/django/django.git synced 2025-10-25 06:36:07 +00:00

Fixed #36005 -- Dropped support for Python 3.10 and 3.11.

This commit is contained in:
Mariusz Felisiak
2025-01-17 22:09:56 +01:00
committed by Sarah Boyce
parent 61dae11df5
commit f5772de696
30 changed files with 79 additions and 266 deletions

View File

@@ -7,7 +7,6 @@ from unittest.suite import TestSuite, _ErrorHolder
from django.test import SimpleTestCase
from django.test.runner import ParallelTestSuite, RemoteTestResult
from django.utils.version import PY311, PY312
try:
import tblib.pickling_support
@@ -193,27 +192,21 @@ class RemoteTestResultTest(SimpleTestCase):
subtest_test.run(result=result)
events = result.events
# addDurations added in Python 3.12.
if PY312:
self.assertEqual(len(events), 5)
else:
self.assertEqual(len(events), 4)
self.assertEqual(len(events), 5)
self.assertIs(result.wasSuccessful(), False)
event = events[1]
self.assertEqual(event[0], "addSubTest")
self.assertEqual(
str(event[2]),
"dummy_test (test_runner.test_parallel.SampleFailingSubtest%s) (index=0)"
# Python 3.11 uses fully qualified test name in the output.
% (".dummy_test" if PY311 else ""),
"dummy_test (test_runner.test_parallel.SampleFailingSubtest.dummy_test) "
"(index=0)",
)
self.assertEqual(repr(event[3][1]), "AssertionError('0 != 1')")
event = events[2]
self.assertEqual(repr(event[3][1]), "AssertionError('2 != 1')")
@unittest.skipUnless(PY312, "unittest --durations option requires Python 3.12")
def test_add_duration(self):
result = RemoteTestResult()
result.addDuration(None, 2.3)