[Python-checkins] bpo-31904: Correct error string in test_file_not_exists() for VxWorks (GH-25965)

miss-islington webhook-mailer at python.org
Sat May 8 04:03:45 EDT 2021


https://github.com/python/cpython/commit/b063b02eabf91bfd4edc0f3fde7ce8f0ebb392c4
commit: b063b02eabf91bfd4edc0f3fde7ce8f0ebb392c4
branch: main
author: pxinwr <peixing.xin at windriver.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2021-05-08T01:03:41-07:00
summary:

bpo-31904: Correct error string in test_file_not_exists() for VxWorks (GH-25965)



The error string on VxWorks is "no such file or directory" for FileNotFoundError. That is, the 1st letter of the error string has lower case.

files:
A Misc/NEWS.d/next/Tests/2021-05-07-15-46-04.bpo-31904.8dk3la.rst
M Lib/test/test_py_compile.py

diff --git a/Lib/test/test_py_compile.py b/Lib/test/test_py_compile.py
index b58f28a4bc8885..5ed98dbff1737e 100644
--- a/Lib/test/test_py_compile.py
+++ b/Lib/test/test_py_compile.py
@@ -276,7 +276,7 @@ def test_file_not_exists(self):
         rc, stdout, stderr = self.pycompilecmd_failure(self.source_path, should_not_exists)
         self.assertEqual(rc, 1)
         self.assertEqual(stdout, b'')
-        self.assertIn(b'No such file or directory', stderr)
+        self.assertIn(b'no such file or directory', stderr.lower())
 
     def test_file_not_exists_with_quiet(self):
         should_not_exists = os.path.join(os.path.dirname(__file__), 'should_not_exists.py')
diff --git a/Misc/NEWS.d/next/Tests/2021-05-07-15-46-04.bpo-31904.8dk3la.rst b/Misc/NEWS.d/next/Tests/2021-05-07-15-46-04.bpo-31904.8dk3la.rst
new file mode 100644
index 00000000000000..334878f91ddacd
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2021-05-07-15-46-04.bpo-31904.8dk3la.rst
@@ -0,0 +1 @@
+Ignore error string case in test_file_not_exists().



More information about the Python-checkins mailing list