diff options
author | Hai Shi <shihai1992@gmail.com> | 2020-08-06 11:51:29 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-06 11:51:29 (GMT) |
commit | 79bb2c93f2d81702fdf1f93720369e18a76b7d1a (patch) | |
tree | 6ab9d0c6ef07954cc871dd6eb06f3a80329d33e6 /Lib/test/test_webbrowser.py | |
parent | 52f98424a55e14f05dfa7483cc0faf634a61c9ff (diff) | |
download | cpython-79bb2c93f2d81702fdf1f93720369e18a76b7d1a.zip cpython-79bb2c93f2d81702fdf1f93720369e18a76b7d1a.tar.gz cpython-79bb2c93f2d81702fdf1f93720369e18a76b7d1a.tar.bz2 |
bpo-40275: Use new test.support helper submodules in tests (GH-21743)
Diffstat (limited to 'Lib/test/test_webbrowser.py')
-rw-r--r-- | Lib/test/test_webbrowser.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_webbrowser.py b/Lib/test/test_webbrowser.py index 6ceb490..673cc99 100644 --- a/Lib/test/test_webbrowser.py +++ b/Lib/test/test_webbrowser.py @@ -6,6 +6,7 @@ import subprocess from unittest import mock from test import support from test.support import import_helper +from test.support import os_helper URL = 'http://www.example.com' @@ -305,7 +306,7 @@ class ImportTest(unittest.TestCase): browser = webbrowser.get().name except (webbrowser.Error, AttributeError) as err: self.skipTest(str(err)) - with support.EnvironmentVarGuard() as env: + with os_helper.EnvironmentVarGuard() as env: env["BROWSER"] = browser webbrowser = import_helper.import_fresh_module('webbrowser') webbrowser.get() @@ -318,12 +319,12 @@ class ImportTest(unittest.TestCase): except (webbrowser.Error, AttributeError, IndexError) as err: self.skipTest(str(err)) - with support.EnvironmentVarGuard() as env: + with os_helper.EnvironmentVarGuard() as env: env["BROWSER"] = least_preferred_browser webbrowser = import_helper.import_fresh_module('webbrowser') self.assertEqual(webbrowser.get().name, least_preferred_browser) - with support.EnvironmentVarGuard() as env: + with os_helper.EnvironmentVarGuard() as env: env["BROWSER"] = sys.executable webbrowser = import_helper.import_fresh_module('webbrowser') self.assertEqual(webbrowser.get().name, sys.executable) |