Skip to content

bpo-34594: Fix usage of hardcoded errno values in the tests #9076

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Lib/test/test_spwd.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ def test_getspnam_exception(self):
spwd.getspnam(name)
except KeyError as exc:
self.skipTest("spwd entry %r doesn't exist: %s" % (name, exc))
else:
self.assertEqual(str(cm.exception), '[Errno 13] Permission denied')


if __name__ == "__main__":
Expand Down
4 changes: 3 additions & 1 deletion Lib/test/test_tabnanny.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""
from unittest import TestCase, mock
from unittest import mock
import errno
import tabnanny
import tokenize
import tempfile
Expand Down Expand Up @@ -232,7 +233,8 @@ def test_when_nannynag_error(self):
def test_when_no_file(self):
"""A python file which does not exist actually in system."""
path = 'no_file.py'
err = f"{path!r}: I/O Error: [Errno 2] No such file or directory: {path!r}\n"
err = f"{path!r}: I/O Error: [Errno {errno.ENOENT}] " \
f"No such file or directory: {path!r}\n"
self.verify_tabnanny_check(path, err=err)

def test_errored_directory(self):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix usage of hardcoded ``errno`` values in the tests.