bpo-40275: Use new test.support helper submodules in tests (GH-20824)

This commit is contained in:
Hai Shi 2020-06-25 20:15:40 +08:00 committed by GitHub
parent 91698d8caa
commit 06a40d7359
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 29 additions and 21 deletions

View file

@ -15,6 +15,7 @@ import re
import io
import contextlib
from test import support
from test.support import os_helper
from test.support import socket_helper
from test.support import threading_helper
from test.support import ALWAYS_EQ, LARGEST, SMALLEST
@ -1372,7 +1373,7 @@ class CGIHandlerTestCase(unittest.TestCase):
self.cgi = None
def test_cgi_get(self):
with support.EnvironmentVarGuard() as env:
with os_helper.EnvironmentVarGuard() as env:
env['REQUEST_METHOD'] = 'GET'
# if the method is GET and no request_text is given, it runs handle_get
# get sysout output
@ -1404,7 +1405,7 @@ class CGIHandlerTestCase(unittest.TestCase):
</methodCall>
"""
with support.EnvironmentVarGuard() as env, \
with os_helper.EnvironmentVarGuard() as env, \
captured_stdout(encoding=self.cgi.encoding) as data_out, \
support.captured_stdin() as data_in:
data_in.write(data)