Skip to content

Commit

Permalink
tests: Fix tests with Python 2.7.13
Browse files Browse the repository at this point in the history
os.putenv got stricter
  • Loading branch information
lazka committed Jul 26, 2017
1 parent 590fbba commit 6ed753a
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,12 +804,11 @@ def test_environ():
with pytest.raises(KeyError):
del environ["foo"]

if os.name == "nt":
with pytest.raises(ValueError):
environ["=="] = "bla"
else:
try:
environ["=="] = "bla"
assert environ["=="] == "bla"
except ValueError:
# fails on Windows and on Linux with some Python versions
pass

assert len(environ) == len(environ.keys())
repr(environ)
Expand Down Expand Up @@ -863,11 +862,10 @@ def test_unsetenv():


def test_putenv():
if os.name == "nt":
with pytest.raises(ValueError):
putenv("==", "bla")
else:
try:
putenv("==", "bla")
except ValueError:
pass


def test_uri2fsn():
Expand Down

0 comments on commit 6ed753a

Please sign in to comment.