Fix test_os: os.environb doesn't exist on Windows
This commit is contained in:
parent
8124feb07b
commit
208d28cd41
|
@ -369,15 +369,17 @@ class EnvironTests(mapping_tests.BasicTestMappingProtocol):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.__save = dict(os.environ)
|
self.__save = dict(os.environ)
|
||||||
self.__saveb = dict(os.environb)
|
if os.name not in ('os2', 'nt'):
|
||||||
|
self.__saveb = dict(os.environb)
|
||||||
for key, value in self._reference().items():
|
for key, value in self._reference().items():
|
||||||
os.environ[key] = value
|
os.environ[key] = value
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
os.environ.clear()
|
os.environ.clear()
|
||||||
os.environ.update(self.__save)
|
os.environ.update(self.__save)
|
||||||
os.environb.clear()
|
if os.name not in ('os2', 'nt'):
|
||||||
os.environb.update(self.__saveb)
|
os.environb.clear()
|
||||||
|
os.environb.update(self.__saveb)
|
||||||
|
|
||||||
def _reference(self):
|
def _reference(self):
|
||||||
return {"KEY1":"VALUE1", "KEY2":"VALUE2", "KEY3":"VALUE3"}
|
return {"KEY1":"VALUE1", "KEY2":"VALUE2", "KEY3":"VALUE3"}
|
||||||
|
|
Loading…
Reference in New Issue