]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-31904: Correct error string in test_file_not_exists() for VxWorks (GH-25965)
authorpxinwr <peixing.xin@windriver.com>
Sat, 8 May 2021 08:03:41 +0000 (16:03 +0800)
committerGitHub <noreply@github.com>
Sat, 8 May 2021 08:03:41 +0000 (01:03 -0700)
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.

Lib/test/test_py_compile.py
Misc/NEWS.d/next/Tests/2021-05-07-15-46-04.bpo-31904.8dk3la.rst [new file with mode: 0644]

index b58f28a4bc8885542b4ef95d80c7fe956e972b4b..5ed98dbff1737ee9aaf6da5276bd35b02a367bfe 100644 (file)
@@ -276,7 +276,7 @@ class PyCompileCLITestCase(unittest.TestCase):
         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 (file)
index 0000000..334878f
--- /dev/null
@@ -0,0 +1 @@
+Ignore error string case in test_file_not_exists().