From ad19219275867f19ea23069496a2f46c64d42db4 Mon Sep 17 00:00:00 2001 From: Ayappan Perumal Date: Thu, 12 May 2022 04:27:33 -0500 Subject: [PATCH 1/6] Skip test_copyfile_nonexistent_dir test on AIX The test uses a trailing slash to force the OS consider the path as a directory, but on AIX the trailing slash has no effect and is considered as a file. --- Lib/test/test_shutil.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index 70033863452805..84d16797051dd5 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -1294,6 +1294,7 @@ def test_copyfile_same_file(self): self.assertEqual(read_file(src_file), 'foo') @unittest.skipIf(MACOS or SOLARIS or _winapi, 'On MACOS, Solaris and Windows the errors are not confusing (though different)') + @unittest.skipIf(AIX, 'Not valid on AIX, see issue #92670') def test_copyfile_nonexistent_dir(self): # Issue 43219 src_dir = self.mkdtemp() From 38cdab332eb8ced8fefa46d757224db214d00b81 Mon Sep 17 00:00:00 2001 From: Ayappan Perumal Date: Thu, 12 May 2022 05:56:42 -0400 Subject: [PATCH 2/6] Add NEWS entry --- .../next/Tests/2022-05-12-05-51-06.gh-issue-92670.7L43Z_.rst | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 Misc/NEWS.d/next/Tests/2022-05-12-05-51-06.gh-issue-92670.7L43Z_.rst diff --git a/Misc/NEWS.d/next/Tests/2022-05-12-05-51-06.gh-issue-92670.7L43Z_.rst b/Misc/NEWS.d/next/Tests/2022-05-12-05-51-06.gh-issue-92670.7L43Z_.rst new file mode 100644 index 00000000000000..0130182ffa24ce --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2022-05-12-05-51-06.gh-issue-92670.7L43Z_.rst @@ -0,0 +1,3 @@ +Skip test_copyfile_nonexistent_dir test on AIX as the test uses a trailing +slash to force the OS consider the path as a directory, but on AIX the +trailing slash has no effect and is considered as a file. From df0c1c0b01626594a2adc4604a252ad42804886c Mon Sep 17 00:00:00 2001 From: Ayappan Perumal Date: Thu, 19 May 2022 04:18:16 -0400 Subject: [PATCH 3/6] Add reason before skipping test_copyfile_nonexistent_dir on AIX --- Lib/test/test_shutil.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index 84d16797051dd5..65c39a771aeee7 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -1294,6 +1294,9 @@ def test_copyfile_same_file(self): self.assertEqual(read_file(src_file), 'foo') @unittest.skipIf(MACOS or SOLARIS or _winapi, 'On MACOS, Solaris and Windows the errors are not confusing (though different)') + # Issue 92670: The test uses a trailing slash to force the OS consider + # the path as a directory, but on AIX the trailing slash has no effect + # and is considered as a file. @unittest.skipIf(AIX, 'Not valid on AIX, see issue #92670') def test_copyfile_nonexistent_dir(self): # Issue 43219 From bc97074fd94f6d02b6016c2c365c541ec7038947 Mon Sep 17 00:00:00 2001 From: Ayappan Perumal Date: Thu, 19 May 2022 04:22:50 -0400 Subject: [PATCH 4/6] Improve NEWS entry --- .../next/Tests/2022-05-12-05-51-06.gh-issue-92670.7L43Z_.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Tests/2022-05-12-05-51-06.gh-issue-92670.7L43Z_.rst b/Misc/NEWS.d/next/Tests/2022-05-12-05-51-06.gh-issue-92670.7L43Z_.rst index 0130182ffa24ce..39b344b3eeaf8b 100644 --- a/Misc/NEWS.d/next/Tests/2022-05-12-05-51-06.gh-issue-92670.7L43Z_.rst +++ b/Misc/NEWS.d/next/Tests/2022-05-12-05-51-06.gh-issue-92670.7L43Z_.rst @@ -1,3 +1,3 @@ -Skip test_copyfile_nonexistent_dir test on AIX as the test uses a trailing +Skip ``test_copyfile_nonexistent_dir`` test on AIX as the test uses a trailing slash to force the OS consider the path as a directory, but on AIX the trailing slash has no effect and is considered as a file. From ee4ed8261aad3de6b70af970e70753db8306fb51 Mon Sep 17 00:00:00 2001 From: Erlend Egeberg Aasland Date: Thu, 19 May 2022 10:44:27 +0200 Subject: [PATCH 5/6] Update Misc/NEWS.d/next/Tests/2022-05-12-05-51-06.gh-issue-92670.7L43Z_.rst --- .../next/Tests/2022-05-12-05-51-06.gh-issue-92670.7L43Z_.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Tests/2022-05-12-05-51-06.gh-issue-92670.7L43Z_.rst b/Misc/NEWS.d/next/Tests/2022-05-12-05-51-06.gh-issue-92670.7L43Z_.rst index 39b344b3eeaf8b..c1349519e7c37c 100644 --- a/Misc/NEWS.d/next/Tests/2022-05-12-05-51-06.gh-issue-92670.7L43Z_.rst +++ b/Misc/NEWS.d/next/Tests/2022-05-12-05-51-06.gh-issue-92670.7L43Z_.rst @@ -1,3 +1,3 @@ -Skip ``test_copyfile_nonexistent_dir`` test on AIX as the test uses a trailing +Skip ``test_shutil.TestCopy.test_copyfile_nonexistent_dir`` test on AIX as the test uses a trailing slash to force the OS consider the path as a directory, but on AIX the trailing slash has no effect and is considered as a file. From c9edd39d5368bda129058f49eca74d401723865d Mon Sep 17 00:00:00 2001 From: Erlend Egeberg Aasland Date: Thu, 19 May 2022 10:47:12 +0200 Subject: [PATCH 6/6] Apply suggestions from code review --- Lib/test/test_shutil.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index 65c39a771aeee7..a61bb126e4e73f 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -1294,10 +1294,10 @@ def test_copyfile_same_file(self): self.assertEqual(read_file(src_file), 'foo') @unittest.skipIf(MACOS or SOLARIS or _winapi, 'On MACOS, Solaris and Windows the errors are not confusing (though different)') - # Issue 92670: The test uses a trailing slash to force the OS consider + # gh-92670: The test uses a trailing slash to force the OS consider # the path as a directory, but on AIX the trailing slash has no effect # and is considered as a file. - @unittest.skipIf(AIX, 'Not valid on AIX, see issue #92670') + @unittest.skipIf(AIX, 'Not valid on AIX, see gh-92670') def test_copyfile_nonexistent_dir(self): # Issue 43219 src_dir = self.mkdtemp()