Skip to content

Commit b634d59

Browse files
committed
Merge remote-tracking branch 'upstream/main'
* upstream/main: Made cosmetic edits to docs/releases/6.0.txt. Refs #36664 -- Added Python 3.15 to daily builds. Refs #36499 -- Made TestUtilsHtml.test_strip_tags() assume behavior change in X.Y.0 version for Python 3.14+. Fixed #36677 -- Fixed scheduling of system checks in ParallelTestSuite workers. Made RemoteTestResultTest.test_pickle_errors_detection() compatible with tblib 3.2+.
2 parents aa06cce + 42d6e20 commit b634d59

File tree

6 files changed

+27
-17
lines changed

6 files changed

+27
-17
lines changed

.github/workflows/schedule_tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
- '3.12'
2424
- '3.13'
2525
- '3.14'
26+
- '3.15-dev'
2627
name: Windows, SQLite, Python ${{ matrix.python-version }}
2728
continue-on-error: true
2829
steps:

django/test/runner.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -463,9 +463,6 @@ def _init_worker(
463463
process_setup(*process_setup_args)
464464
django.setup()
465465
setup_test_environment(debug=debug_mode)
466-
call_command(
467-
"check", stdout=io.StringIO(), stderr=io.StringIO(), databases=used_aliases
468-
)
469466

470467
db_aliases = used_aliases if used_aliases is not None else connections
471468
for alias in db_aliases:
@@ -477,6 +474,11 @@ def _init_worker(
477474
connection._test_serialized_contents = value
478475
connection.creation.setup_worker_connection(_worker_id)
479476

477+
if is_spawn_or_forkserver:
478+
call_command(
479+
"check", stdout=io.StringIO(), stderr=io.StringIO(), databases=used_aliases
480+
)
481+
480482

481483
def _run_subsuite(args):
482484
"""

docs/releases/6.0.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ Backends are configured via the :setting:`TASKS` setting. The :ref:`two
124124
built-in backends <task-available-backends>` included in this release are
125125
primarily intended for development and testing.
126126

127-
Django handles task creation and queuing but does not provide a worker
127+
Django handles task creation and queuing, but does not provide a worker
128128
mechanism to run tasks. Execution must be managed by external infrastructure,
129129
such as a separate process or service.
130130

@@ -575,7 +575,7 @@ to remove usage of these features.
575575
* Support for calling ``format_html()`` without passing args or kwargs is
576576
removed.
577577

578-
* The default scheme for ``forms.URLField`` changed from ``"http"`` to
578+
* The default scheme for ``forms.URLField`` has changed from ``"http"`` to
579579
``"https"``.
580580

581581
* The ``FORMS_URLFIELD_ASSUME_HTTPS`` transitional setting is removed.

tests/requirements/py3.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ black >= 25.9.0
66
docutils >= 0.22
77
geoip2 >= 4.8.0
88
jinja2 >= 2.11.0
9-
numpy >= 1.26.0
10-
Pillow >= 10.1.0
9+
numpy >= 1.26.0; sys.platform != 'win32' or python_version < '3.15'
10+
Pillow >= 10.1.0; sys.platform != 'win32' or python_version < '3.15'
1111
# pylibmc/libmemcached can't be built on Windows.
1212
pylibmc; sys_platform != 'win32'
1313
pymemcache >= 3.4.0

tests/test_runner/test_parallel.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ class ExceptionThatFailsUnpickling(Exception):
3232
def __init__(self, arg):
3333
super().__init__()
3434

35+
def __reduce__(self):
36+
# tblib 3.2+ makes exception subclasses picklable by default.
37+
# Return (cls, ()) so the constructor fails on unpickle, preserving
38+
# the needed behavior for test_pickle_errors_detection.
39+
return (self.__class__, ())
40+
3541

3642
class ParallelTestRunnerTest(SimpleTestCase):
3743
"""
@@ -170,6 +176,8 @@ def test_pickle_errors_detection(self):
170176
result = RemoteTestResult()
171177
result._confirm_picklable(picklable_error)
172178

179+
# The exception can be pickled but not unpickled.
180+
pickle.dumps(not_unpicklable_error)
173181
msg = "__init__() missing 1 required positional argument"
174182
with self.assertRaisesMessage(TypeError, msg):
175183
result._confirm_picklable(not_unpicklable_error)

tests/utils_tests/test_html.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -116,21 +116,20 @@ def test_linebreaks(self):
116116
self.check_output(linebreaks, lazystr(value), output)
117117

118118
def test_strip_tags(self):
119-
# Python fixed a quadratic-time issue in HTMLParser in 3.13.6, 3.12.12,
120-
# 3.11.14, 3.10.19, and 3.9.24. The fix slightly changes HTMLParser's
121-
# output, so tests for particularly malformed input must handle both
122-
# old and new results. The check below is temporary until all supported
123-
# Python versions and CI workers include the fix. See:
119+
# Python fixed a quadratic-time issue in HTMLParser in 3.13.6, 3.12.12.
120+
# The fix slightly changes HTMLParser's output, so tests for
121+
# particularly malformed input must handle both old and new results.
122+
# The check below is temporary until all supported Python versions and
123+
# CI workers include the fix. See:
124124
# https://github.com/python/cpython/commit/6eb6c5db
125125
min_fixed = {
126-
(3, 14): (3, 14),
127126
(3, 13): (3, 13, 6),
128127
(3, 12): (3, 12, 12),
129-
(3, 11): (3, 11, 14),
130-
(3, 10): (3, 10, 19),
131-
(3, 9): (3, 9, 24),
132128
}
133-
htmlparser_fixed = sys.version_info >= min_fixed[sys.version_info[:2]]
129+
major_version = sys.version_info[:2]
130+
htmlparser_fixed = sys.version_info >= min_fixed.get(
131+
major_version, major_version
132+
)
134133
items = (
135134
(
136135
"<p>See: &#39;&eacute; is an apostrophe followed by e acute</p>",

0 commit comments

Comments
 (0)