diff options
author | Gregory P. Smith <greg@krypto.org> | 2018-01-17 22:57:57 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-17 22:57:57 (GMT) |
commit | 3941499d6c2a4d09f2ea476f84b9c4ddc4bdefa0 (patch) | |
tree | 8053b20afdd9917a09e41e3482554296b07bef36 | |
parent | e860089fd93728824cf586fa4d91f08eff3bab73 (diff) | |
download | cpython-3941499d6c2a4d09f2ea476f84b9c4ddc4bdefa0.zip cpython-3941499d6c2a4d09f2ea476f84b9c4ddc4bdefa0.tar.gz cpython-3941499d6c2a4d09f2ea476f84b9c4ddc4bdefa0.tar.bz2 |
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.
-rw-r--r-- | Lib/test/test_glob.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_glob.py b/Lib/test/test_glob.py index dce64f9..767bd37 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, **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): |