diff options
author | Daniel Hahler <git@thequod.de> | 2020-12-21 06:38:02 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-21 06:38:02 (GMT) |
commit | 37a6d5f8027f969418fe53d0a73a21003a8e370d (patch) | |
tree | d858ec901fe681a2bdb2bc03a5aa308ba125182b | |
parent | ab74c014ae514fde7487542ec96ef45235aa86b0 (diff) | |
download | cpython-37a6d5f8027f969418fe53d0a73a21003a8e370d.zip cpython-37a6d5f8027f969418fe53d0a73a21003a8e370d.tar.gz cpython-37a6d5f8027f969418fe53d0a73a21003a8e370d.tar.bz2 |
[WIP/RFC] bpo-15872: tests: remove oddity from test_rmtree_errors (GH-22967)
This was added for (some) Windows buildbots back in 2012, and should
either not be necessary anymore, or it should probably get investigated
why "\*.*" gets added to filenames in the first place.
Ref:
Automerge-Triggered-By: GH:hynek
-rw-r--r-- | Lib/test/test_shutil.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index df7fbed..df8dcdc 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -280,10 +280,7 @@ class TestRmTree(BaseTest, unittest.TestCase): filename = os.path.join(tmpdir, "tstfile") with self.assertRaises(NotADirectoryError) as cm: shutil.rmtree(filename) - # The reason for this rather odd construct is that Windows sprinkles - # a \*.* at the end of file names. But only sometimes on some buildbots - possible_args = [filename, os.path.join(filename, '*.*')] - self.assertIn(cm.exception.filename, possible_args) + self.assertEqual(cm.exception.filename, filename) self.assertTrue(os.path.exists(filename)) # test that ignore_errors option is honored shutil.rmtree(filename, ignore_errors=True) @@ -296,11 +293,11 @@ class TestRmTree(BaseTest, unittest.TestCase): self.assertIs(errors[0][0], os.scandir) self.assertEqual(errors[0][1], filename) self.assertIsInstance(errors[0][2][1], NotADirectoryError) - self.assertIn(errors[0][2][1].filename, possible_args) + self.assertEqual(errors[0][2][1].filename, filename) self.assertIs(errors[1][0], os.rmdir) self.assertEqual(errors[1][1], filename) self.assertIsInstance(errors[1][2][1], NotADirectoryError) - self.assertIn(errors[1][2][1].filename, possible_args) + self.assertEqual(errors[1][2][1].filename, filename) @unittest.skipIf(sys.platform[:6] == 'cygwin', |