Skip to content

Commit b8c1202

Browse files
picnixzseehwan80
authored andcommitted
pythongh-131254: ensure that BROWSER is not set for test_webbrowser on macOS (python#131276)
1 parent 12bd670 commit b8c1202

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Lib/test/test_webbrowser.py

+6
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,13 @@ def close(self):
321321
@unittest.skipUnless(sys.platform == "darwin", "macOS specific test")
322322
@requires_subprocess()
323323
class MacOSXOSAScriptTest(unittest.TestCase):
324+
324325
def setUp(self):
326+
# Ensure that 'BROWSER' is not set to 'open' or something else.
327+
# See: https://github.com/python/cpython/issues/131254.
328+
env = self.enterContext(os_helper.EnvironmentVarGuard())
329+
env.unset("BROWSER")
330+
325331
support.patch(self, os, "popen", self.mock_popen)
326332
self.browser = webbrowser.MacOSXOSAScript("default")
327333

0 commit comments

Comments
 (0)