From b1a52b11673f6fd29b357852977282c8b41cfb7d Mon Sep 17 00:00:00 2001 From: "Gregory P. Smith" Date: Wed, 17 Jan 2018 15:15:46 -0800 Subject: [PATCH] Use assertItemsEqual instead of assertEqual. (#5224) This test doesn't care about order, the underlying filesystem APIs do not guarantee directory listings on subsequent calls will be in the same order. --- Lib/test/test_glob.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/test/test_glob.py b/Lib/test/test_glob.py index b360d09dfa..84b2e7ddd2 100644 --- a/Lib/test/test_glob.py +++ b/Lib/test/test_glob.py @@ -49,10 +49,10 @@ class GlobTests(unittest.TestCase): pattern = os.path.join(*parts) p = os.path.join(self.tempdir, pattern) res = glob.glob(p) - self.assertEqual(list(glob.iglob(p)), res) + self.assertItemsEqual(glob.iglob(p), res) ures = [fsdecode(x) for x in res] - self.assertEqual(glob.glob(fsdecode(p)), ures) - self.assertEqual(list(glob.iglob(fsdecode(p))), ures) + self.assertItemsEqual(glob.glob(fsdecode(p)), ures) + self.assertItemsEqual(glob.iglob(fsdecode(p)), ures) return res def assertSequencesEqual_noorder(self, l1, l2): -- 2.50.1