]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-31904: fix test_doctest.py failures for VxWorks (GH-23419)
authorpxinwr <peixing.xin@windriver.com>
Fri, 4 Dec 2020 20:19:32 +0000 (04:19 +0800)
committerGitHub <noreply@github.com>
Fri, 4 Dec 2020 20:19:32 +0000 (12:19 -0800)
Fix test_doctest.py failures for VxWorks by avoiding exact error message checks. (better for everyone all around)

Lib/test/test_doctest.py
Misc/NEWS.d/next/Tests/2020-11-20-15-07-18.bpo-31904.EBJXjJ.rst [new file with mode: 0644]

index bff20f9cac9c989f17f3b701abd2346ac6526a39..6a5013f5b8afc3971637f5d371c4151e16eb2f9b 100644 (file)
@@ -3039,10 +3039,11 @@ Invalid file name:
     ...         '-m', 'doctest', 'nosuchfile')
     >>> rc, out
     (1, b'')
+    >>> # The exact error message changes depending on the platform.
     >>> print(normalize(err))                    # doctest: +ELLIPSIS
     Traceback (most recent call last):
       ...
-    FileNotFoundError: [Errno ...] No such file or directory: 'nosuchfile'
+    FileNotFoundError: [Errno ...] ...nosuchfile...
 
 Invalid doctest option:
 
diff --git a/Misc/NEWS.d/next/Tests/2020-11-20-15-07-18.bpo-31904.EBJXjJ.rst b/Misc/NEWS.d/next/Tests/2020-11-20-15-07-18.bpo-31904.EBJXjJ.rst
new file mode 100644 (file)
index 0000000..e5e66ce
--- /dev/null
@@ -0,0 +1 @@
+Fix test_doctest.py failures for VxWorks.