From 5f723dbcb8938ec86d5f729649dd9ba097c109f9 Mon Sep 17 00:00:00 2001 From: pxin Date: Fri, 20 Nov 2020 15:10:28 +0800 Subject: [PATCH 1/4] fix test_doctest.py failures for VxWorks --- Lib/test/test_doctest.py | 2 ++ Misc/NEWS.d/next/Tests/2020-11-20-15-07-18.bpo-31904.EBJXjJ.rst | 1 + 2 files changed, 3 insertions(+) create mode 100644 Misc/NEWS.d/next/Tests/2020-11-20-15-07-18.bpo-31904.EBJXjJ.rst diff --git a/Lib/test/test_doctest.py b/Lib/test/test_doctest.py index bff20f9cac9c98..c3452a3dc7ae47 100644 --- a/Lib/test/test_doctest.py +++ b/Lib/test/test_doctest.py @@ -3039,6 +3039,8 @@ def test_CLI(): r""" ... '-m', 'doctest', 'nosuchfile') >>> rc, out (1, b'') + >>> if sys.platform == "vxworks": + ... err = err.replace(b'no such file', b'No such file') >>> print(normalize(err)) # doctest: +ELLIPSIS Traceback (most recent call last): ... 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 index 00000000000000..ceacd575c04cc0 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2020-11-20-15-07-18.bpo-31904.EBJXjJ.rst @@ -0,0 +1 @@ +fix test_doctest.py failures for VxWorks From 6e354ddd8a0684733707f1d1f3661db46ac86dc4 Mon Sep 17 00:00:00 2001 From: pxin Date: Wed, 2 Dec 2020 15:40:58 +0800 Subject: [PATCH 2/4] remove case sensitive error message for FileNotFoundError --- Lib/test/test_doctest.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Lib/test/test_doctest.py b/Lib/test/test_doctest.py index c3452a3dc7ae47..51123e78a778ff 100644 --- a/Lib/test/test_doctest.py +++ b/Lib/test/test_doctest.py @@ -3039,12 +3039,10 @@ def test_CLI(): r""" ... '-m', 'doctest', 'nosuchfile') >>> rc, out (1, b'') - >>> if sys.platform == "vxworks": - ... err = err.replace(b'no such file', b'No such file') >>> print(normalize(err)) # doctest: +ELLIPSIS Traceback (most recent call last): ... - FileNotFoundError: [Errno ...] No such file or directory: 'nosuchfile' + FileNotFoundError: [Errno ...] ...nosuchfile... Invalid doctest option: From 677894bf12afe03d9715eeda3e8b932cbf314b8b Mon Sep 17 00:00:00 2001 From: pxin Date: Wed, 2 Dec 2020 15:41:36 +0800 Subject: [PATCH 3/4] refine news --- Misc/NEWS.d/next/Tests/2020-11-20-15-07-18.bpo-31904.EBJXjJ.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index ceacd575c04cc0..e5e66ceea44021 100644 --- 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 @@ -1 +1 @@ -fix test_doctest.py failures for VxWorks +Fix test_doctest.py failures for VxWorks. From acc07c08ba67d12ffcdbcb183df508448d7708a9 Mon Sep 17 00:00:00 2001 From: pxin Date: Fri, 4 Dec 2020 15:18:28 +0800 Subject: [PATCH 4/4] add comment for FileNotFoundError --- Lib/test/test_doctest.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Lib/test/test_doctest.py b/Lib/test/test_doctest.py index 51123e78a778ff..6a5013f5b8afc3 100644 --- a/Lib/test/test_doctest.py +++ b/Lib/test/test_doctest.py @@ -3039,6 +3039,7 @@ def test_CLI(): r""" ... '-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): ...