Change EnvironmentError, IOError to OSError - they are aliases

Since Python 3.3, these are aliases for OSError:
https://docs.python.org/3/whatsnew/3.3.html#pep-3151-reworking-the-os-and-io-exception-hierarchy
This commit is contained in:
Ran Benita
2020-03-27 18:40:23 +03:00
parent 83e18776f6
commit a785754523
15 changed files with 35 additions and 35 deletions
+5 -5
View File
@@ -829,10 +829,10 @@ def test_dontreadfrominput():
f = DontReadFromInput()
assert f.buffer is f
assert not f.isatty()
pytest.raises(IOError, f.read)
pytest.raises(IOError, f.readlines)
pytest.raises(OSError, f.read)
pytest.raises(OSError, f.readlines)
iter_f = iter(f)
pytest.raises(IOError, next, iter_f)
pytest.raises(OSError, next, iter_f)
pytest.raises(UnsupportedOperation, f.fileno)
f.close() # just for completeness
@@ -1083,7 +1083,7 @@ class TestStdCapture:
print("XXX which indicates an error in the underlying capturing")
print("XXX mechanisms")
with self.getcapture():
pytest.raises(IOError, sys.stdin.read)
pytest.raises(OSError, sys.stdin.read)
class TestTeeStdCapture(TestStdCapture):
@@ -1356,7 +1356,7 @@ def test_crash_on_closing_tmpfile_py27(testdir):
result = testdir.runpytest_subprocess(str(p))
assert result.ret == 0
assert result.stderr.str() == ""
result.stdout.no_fnmatch_line("*IOError*")
result.stdout.no_fnmatch_line("*OSError*")
def test_global_capture_with_live_logging(testdir):