Skip to content

Commit 9b6cef0

Browse files
authored
gh-131254: ensure that BROWSER is not set for test_webbrowser on macOS (#131276)
1 parent 3185e31 commit 9b6cef0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Lib/test/test_webbrowser.py

Lines changed: 6 additions & 0 deletions
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)