mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
bpo-40275: Use new test.support helper submodules in tests (GH-20824)
This commit is contained in:
parent
91698d8caa
commit
06a40d7359
9 changed files with 29 additions and 21 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue