mirror of
https://github.com/python/cpython.git
synced 2025-08-31 22:18:28 +00:00
bpo-40275: Use new test.support helper submodules in tests (GH-21448)
This commit is contained in:
parent
bb0424b122
commit
4660597b51
20 changed files with 185 additions and 154 deletions
|
@ -13,6 +13,7 @@ import argparse
|
|||
from io import StringIO
|
||||
|
||||
from test import support
|
||||
from test.support import os_helper
|
||||
from unittest import mock
|
||||
class StdIOBuffer(StringIO):
|
||||
pass
|
||||
|
@ -23,7 +24,7 @@ class TestCase(unittest.TestCase):
|
|||
# The tests assume that line wrapping occurs at 80 columns, but this
|
||||
# behaviour can be overridden by setting the COLUMNS environment
|
||||
# variable. To ensure that this width is used, set COLUMNS to 80.
|
||||
env = support.EnvironmentVarGuard()
|
||||
env = os_helper.EnvironmentVarGuard()
|
||||
env['COLUMNS'] = '80'
|
||||
self.addCleanup(env.__exit__)
|
||||
|
||||
|
@ -3244,7 +3245,7 @@ class TestShortColumns(HelpTestCase):
|
|||
but we don't want any exceptions thrown in such cases. Only ugly representation.
|
||||
'''
|
||||
def setUp(self):
|
||||
env = support.EnvironmentVarGuard()
|
||||
env = os_helper.EnvironmentVarGuard()
|
||||
env.set("COLUMNS", '15')
|
||||
self.addCleanup(env.__exit__)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue