Skip to content

Commit 36c41bc

Browse files
LihuaZhaovstinner
authored andcommitted
bpo-31904: Fix test_tabnanny on VxWorks (GH-12646)
Fix test_tabnanny on VxWorks: adjust ENOENT error message, use os.strerror().
1 parent 6fec905 commit 36c41bc

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Lib/test/test_tabnanny.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
from unittest import TestCase, mock
77
from unittest import mock
88
import errno
9+
import os
10+
import sys
911
import tabnanny
1012
import tokenize
1113
import tempfile
@@ -233,8 +235,8 @@ def test_when_nannynag_error(self):
233235
def test_when_no_file(self):
234236
"""A python file which does not exist actually in system."""
235237
path = 'no_file.py'
236-
err = f"{path!r}: I/O Error: [Errno {errno.ENOENT}] " \
237-
f"No such file or directory: {path!r}\n"
238+
err = (f"{path!r}: I/O Error: [Errno {errno.ENOENT}] "
239+
f"{os.strerror(errno.ENOENT)}: {path!r}\n")
238240
self.verify_tabnanny_check(path, err=err)
239241

240242
def test_errored_directory(self):
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix test_tabnanny on VxWorks: adjust ENOENT error message.

0 commit comments

Comments
 (0)