summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLihua Zhao <44661095+LihuaZhao@users.noreply.github.com>2019-04-17 09:46:50 (GMT)
committerVictor Stinner <vstinner@redhat.com>2019-04-17 09:46:50 (GMT)
commit36c41bc2017921321dbb19557f616a6bb7572c83 (patch)
tree57576bb056243b6735b9ec585e50feef1463ef62
parent6fec905de5c139017f36b212e54cac46959808fe (diff)
downloadcpython-36c41bc2017921321dbb19557f616a6bb7572c83.zip
cpython-36c41bc2017921321dbb19557f616a6bb7572c83.tar.gz
cpython-36c41bc2017921321dbb19557f616a6bb7572c83.tar.bz2
bpo-31904: Fix test_tabnanny on VxWorks (GH-12646)
Fix test_tabnanny on VxWorks: adjust ENOENT error message, use os.strerror().
-rw-r--r--Lib/test/test_tabnanny.py6
-rw-r--r--Misc/NEWS.d/next/Tests/2019-04-01-16-06-36.bpo-31904.peaceF.rst1
2 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_tabnanny.py b/Lib/test/test_tabnanny.py
index 845096e..81549d1 100644
--- a/Lib/test/test_tabnanny.py
+++ b/Lib/test/test_tabnanny.py
@@ -6,6 +6,8 @@ Glossary:
from unittest import TestCase, mock
from unittest import mock
import errno
+import os
+import sys
import tabnanny
import tokenize
import tempfile
@@ -233,8 +235,8 @@ class TestCheck(TestCase):
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 {errno.ENOENT}] " \
- f"No such file or directory: {path!r}\n"
+ err = (f"{path!r}: I/O Error: [Errno {errno.ENOENT}] "
+ f"{os.strerror(errno.ENOENT)}: {path!r}\n")
self.verify_tabnanny_check(path, err=err)
def test_errored_directory(self):
diff --git a/Misc/NEWS.d/next/Tests/2019-04-01-16-06-36.bpo-31904.peaceF.rst b/Misc/NEWS.d/next/Tests/2019-04-01-16-06-36.bpo-31904.peaceF.rst
new file mode 100644
index 0000000..6297717
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2019-04-01-16-06-36.bpo-31904.peaceF.rst
@@ -0,0 +1 @@
+Fix test_tabnanny on VxWorks: adjust ENOENT error message.