Skip to content

Commit

Permalink
Use assertCountEqual instead of assertEqual. (python#5223)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gpshead authored Jan 17, 2018
1 parent e860089 commit 3941499
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Lib/test/test_glob.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ def glob(self, *parts, **kwargs):
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):
Expand Down

0 comments on commit 3941499

Please sign in to comment.