From d0659443537959e1b4498cc718a03b1cc7e4cc9b Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Thu, 12 Jan 2023 06:04:10 +0100 Subject: [PATCH] [4.0.x] Fixed thread termination in servers.tests.LiveServerPort on Python 3.10.9+. Class cleanups registered in TestCase subclasses are no longer called as TestCase.doClassCleanups() only cleans up the particular class, see https://github.com/python/cpython/commit/c2102136be569e6fc8ed90181f229b46d07142f8 Backport of d02a9f0cee84e3d23f676bdf2ab6aadbf4a5bfe8 from main. --- tests/servers/tests.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/servers/tests.py b/tests/servers/tests.py index a54421fe78..03496c3d2a 100644 --- a/tests/servers/tests.py +++ b/tests/servers/tests.py @@ -364,6 +364,7 @@ class LiveServerPort(LiveServerBase): % self.live_server_url, ) finally: + TestCase.doClassCleanups() TestCase.tearDownClass() def test_specified_port_bind(self): @@ -383,6 +384,7 @@ class LiveServerPort(LiveServerBase): % TestCase.port, ) finally: + TestCase.doClassCleanups() TestCase.tearDownClass()