Commit 3941499d authored by Gregory P. Smith's avatar Gregory P. Smith Committed by GitHub

Use assertCountEqual instead of assertEqual. (#5223)

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.
parent e860089f
......@@ -49,10 +49,10 @@ class GlobTests(unittest.TestCase):
pattern = os.path.join(*parts)
p = os.path.join(self.tempdir, pattern)
res = glob.glob(p, **kwargs)
self.assertEqual(list(glob.iglob(p, **kwargs)), res)
self.assertCountEqual(glob.iglob(p, **kwargs), res)
bres = [os.fsencode(x) for x in res]
self.assertEqual(glob.glob(os.fsencode(p), **kwargs), bres)
self.assertEqual(list(glob.iglob(os.fsencode(p), **kwargs)), bres)
self.assertCountEqual(glob.glob(os.fsencode(p), **kwargs), bres)
self.assertCountEqual(glob.iglob(os.fsencode(p), **kwargs), bres)
return res
def assertSequencesEqual_noorder(self, l1, l2):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment