bpo-40275: Adding threading_helper submodule in test.support (GH-20263)

This commit is contained in:
Hai Shi 2020-05-28 06:10:27 +08:00 committed by GitHub
parent 7d80b35af1
commit e80697d687
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 483 additions and 428 deletions

View file

@ -14,8 +14,9 @@ import unittest
import socketserver
import test.support
from test.support import reap_children, reap_threads, verbose
from test.support import reap_children, verbose
from test.support import socket_helper
from test.support import threading_helper
test.support.requires("network")
@ -120,7 +121,7 @@ class SocketServerTest(unittest.TestCase):
self.assertEqual(server.server_address, server.socket.getsockname())
return server
@reap_threads
@threading_helper.reap_threads
def run_server(self, svrcls, hdlrbase, testfunc):
server = self.make_server(self.pickaddr(svrcls.address_family),
svrcls, hdlrbase)
@ -249,7 +250,7 @@ class SocketServerTest(unittest.TestCase):
socketserver.DatagramRequestHandler,
self.dgram_examine)
@reap_threads
@threading_helper.reap_threads
def test_shutdown(self):
# Issue #2302: shutdown() should always succeed in making an
# other thread leave serve_forever().