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>
This commit is contained in:
Bénédikt Tran 2025-03-16 14:09:33 +01:00 committed by GitHub
parent 9558d22ac3
commit 3185e3115c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 38 additions and 45 deletions

View file

@ -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)