From 3185e3115c918ec189e16cf9f5b51a13a0146556 Mon Sep 17 00:00:00 2001 From: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Date: Sun, 16 Mar 2025 14:09:33 +0100 Subject: gh-131277: allow `EnvironmentVarGuard` to unset more than one environment variable at once (#131280) Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- Lib/test/test_getopt.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Lib/test/test_getopt.py') diff --git a/Lib/test/test_getopt.py b/Lib/test/test_getopt.py index ed967ad2761..8d0d5084abb 100644 --- a/Lib/test/test_getopt.py +++ b/Lib/test/test_getopt.py @@ -13,8 +13,7 @@ sentinel = object() class GetoptTests(unittest.TestCase): def setUp(self): self.env = self.enterContext(EnvironmentVarGuard()) - if "POSIXLY_CORRECT" in self.env: - del self.env["POSIXLY_CORRECT"] + del self.env["POSIXLY_CORRECT"] def assertError(self, *args, **kwargs): self.assertRaises(getopt.GetoptError, *args, **kwargs) -- cgit v1.2.3