Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3941499

Browse files
authored
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.
1 parent e860089 commit 3941499

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Lib/test/test_glob.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ def glob(self, *parts, **kwargs):
4949
pattern = os.path.join(*parts)
5050
p = os.path.join(self.tempdir, pattern)
5151
res = glob.glob(p, **kwargs)
52-
self.assertEqual(list(glob.iglob(p, **kwargs)), res)
52+
self.assertCountEqual(glob.iglob(p, **kwargs), res)
5353
bres = [os.fsencode(x) for x in res]
54-
self.assertEqual(glob.glob(os.fsencode(p), **kwargs), bres)
55-
self.assertEqual(list(glob.iglob(os.fsencode(p), **kwargs)), bres)
54+
self.assertCountEqual(glob.glob(os.fsencode(p), **kwargs), bres)
55+
self.assertCountEqual(glob.iglob(os.fsencode(p), **kwargs), bres)
5656
return res
5757

5858
def assertSequencesEqual_noorder(self, l1, l2):

0 commit comments

Comments
 (0)