https://github.com/python/cpython/commit/9b6cef0f5dcb309096a68fdd04158e0e1313e8ec commit: 9b6cef0f5dcb309096a68fdd04158e0e1313e8ec branch: main author: Bénédikt Tran <10796600+picn...@users.noreply.github.com> committer: picnixz <10796600+picn...@users.noreply.github.com> date: 2025-03-16T15:39:30+01:00 summary:
gh-131254: ensure that `BROWSER` is not set for `test_webbrowser` on macOS (#131276) files: M Lib/test/test_webbrowser.py diff --git a/Lib/test/test_webbrowser.py b/Lib/test/test_webbrowser.py index 870ddd7349f494..4c3ea1cd8df13e 100644 --- a/Lib/test/test_webbrowser.py +++ b/Lib/test/test_webbrowser.py @@ -321,7 +321,13 @@ def close(self): @unittest.skipUnless(sys.platform == "darwin", "macOS specific test") @requires_subprocess() class MacOSXOSAScriptTest(unittest.TestCase): + def setUp(self): + # Ensure that 'BROWSER' is not set to 'open' or something else. + # See: https://github.com/python/cpython/issues/131254. + env = self.enterContext(os_helper.EnvironmentVarGuard()) + env.unset("BROWSER") + support.patch(self, os, "popen", self.mock_popen) self.browser = webbrowser.MacOSXOSAScript("default") _______________________________________________ Python-checkins mailing list -- python-checkins@python.org To unsubscribe send an email to python-checkins-le...@python.org https://mail.python.org/mailman3/lists/python-checkins.python.org/ Member address: arch...@mail-archive.com