summaryrefslogtreecommitdiff
path: root/tests/test_runner/test_parallel.py
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2022-04-07 07:02:21 +0200
committerGitHub <noreply@github.com>2022-04-07 07:02:21 +0200
commit2ee4caf56b8e000cabbb73ad81ff05738d6d0a35 (patch)
tree235be4c93977ad91f8fae7517b4e5b8ad629db32 /tests/test_runner/test_parallel.py
parentbfe9665502c77baf14ce6cf52af974033bd43164 (diff)
Refs #33173 -- Fixed test_runner/test_utils tests on Python 3.11+.
Python 3.11 uses fully qualified test name in unittest output. See https://github.com/python/cpython/commit/755be9b1505af591b9f2ee424a6525b6c2b65ce9
Diffstat (limited to 'tests/test_runner/test_parallel.py')
-rw-r--r--tests/test_runner/test_parallel.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/test_runner/test_parallel.py b/tests/test_runner/test_parallel.py
index ca208f6a48..a2f68d3512 100644
--- a/tests/test_runner/test_parallel.py
+++ b/tests/test_runner/test_parallel.py
@@ -4,6 +4,7 @@ import unittest
from django.test import SimpleTestCase
from django.test.runner import RemoteTestResult
+from django.utils.version import PY311
try:
import tblib.pickling_support
@@ -125,7 +126,9 @@ class RemoteTestResultTest(SimpleTestCase):
self.assertEqual(event[0], "addSubTest")
self.assertEqual(
str(event[2]),
- "dummy_test (test_runner.test_parallel.SampleFailingSubtest) (index=0)",
+ "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 ""),
)
self.assertEqual(repr(event[3][1]), "AssertionError('0 != 1')")