summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2020-12-21 06:38:02 (GMT)
committerGitHub <noreply@github.com>2020-12-21 06:38:02 (GMT)
commit37a6d5f8027f969418fe53d0a73a21003a8e370d (patch)
treed858ec901fe681a2bdb2bc03a5aa308ba125182b
parentab74c014ae514fde7487542ec96ef45235aa86b0 (diff)
downloadcpython-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.py9
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',