]> granicus.if.org Git - python/commitdiff
Issue #13436: Fix unsetenv() test on Windows
authorVictor Stinner <victor.stinner@haypocalc.com>
Tue, 22 Nov 2011 21:30:19 +0000 (22:30 +0100)
committerVictor Stinner <victor.stinner@haypocalc.com>
Tue, 22 Nov 2011 21:30:19 +0000 (22:30 +0100)
Lib/test/test_os.py

index 4e4956e9537216714da83ee80ea2b769f083df34..eab8f528cbba4a4ee661ccababdebc95f77df75e 100644 (file)
@@ -365,10 +365,11 @@ class EnvironTests(mapping_tests.BasicTestMappingProtocol):
         if sys.platform == "win32":
             # an environment variable is limited to 32,767 characters
             key = 'x' * 50000
+            self.assertRaises(ValueError, os.environ.__delitem__, key)
         else:
             # "=" is not allowed in a variable name
             key = 'key='
-        self.assertRaises(OSError, os.environ.__delitem__, key)
+            self.assertRaises(OSError, os.environ.__delitem__, key)
 
 class WalkTests(unittest.TestCase):
     """Tests for os.walk()."""