mirror of
https://github.com/python/cpython.git
synced 2025-09-30 20:31:52 +00:00
Use assertCountEqual instead of assertEqual. (GH-5223) (#5225)
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.
(cherry picked from commit 3941499d6c)
This commit is contained in:
parent
4e09c0c858
commit
8d1e41d414
1 changed files with 3 additions and 3 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue