bpo-31904: Fix test_tabnanny on VxWorks (GH-12646)

Fix test_tabnanny on VxWorks: adjust ENOENT error message,
use os.strerror().
This commit is contained in:
Lihua Zhao 2019-04-17 17:46:50 +08:00 committed by Victor Stinner
parent 6fec905de5
commit 36c41bc201
2 changed files with 5 additions and 2 deletions

View File

@ -6,6 +6,8 @@ Glossary:
from unittest import TestCase, mock from unittest import TestCase, mock
from unittest import mock from unittest import mock
import errno import errno
import os
import sys
import tabnanny import tabnanny
import tokenize import tokenize
import tempfile import tempfile
@ -233,8 +235,8 @@ class TestCheck(TestCase):
def test_when_no_file(self): def test_when_no_file(self):
"""A python file which does not exist actually in system.""" """A python file which does not exist actually in system."""
path = 'no_file.py' path = 'no_file.py'
err = f"{path!r}: I/O Error: [Errno {errno.ENOENT}] " \ err = (f"{path!r}: I/O Error: [Errno {errno.ENOENT}] "
f"No such file or directory: {path!r}\n" f"{os.strerror(errno.ENOENT)}: {path!r}\n")
self.verify_tabnanny_check(path, err=err) self.verify_tabnanny_check(path, err=err)
def test_errored_directory(self): def test_errored_directory(self):

View File

@ -0,0 +1 @@
Fix test_tabnanny on VxWorks: adjust ENOENT error message.