From cff987ef677280f15aa860bc99220852826566c7 Mon Sep 17 00:00:00 2001 From: wangzihao Date: Thu, 17 Sep 2020 17:19:01 +0800 Subject: [PATCH] Replace assertItemsEqual with assertCountEqual assertItemsEqual was removed from Python's unittest.TestCase in Python 3.3 [1][2]. We have been able to use them since then, because testtools required unittest2, which still included it. With testtools removing Python 2.7 support [3][4], we will lose support for assertItemsEqual, so we should switch to use assertCountEqual. [1] - https://bugs.python.org/issue17866 [2] - https://hg.python.org/cpython/rev/d9921cb6e3cd [3] - testing-cabal/testtools#286 [4] - testing-cabal/testtools#277 Change-Id: Ib8c2acb373db791c0b74b8bea30d424dc44325a5 --- cloudkitty/tests/fetchers/test_prometheus.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudkitty/tests/fetchers/test_prometheus.py b/cloudkitty/tests/fetchers/test_prometheus.py index e3d7f2d1..774bce07 100644 --- a/cloudkitty/tests/fetchers/test_prometheus.py +++ b/cloudkitty/tests/fetchers/test_prometheus.py @@ -89,7 +89,7 @@ class PrometheusFetcherTest(tests.TestCase): with response: scopes = self.fetcher.get_tenants() - self.assertItemsEqual(scopes, [ + self.assertCountEqual(scopes, [ 'scope_id1', 'scope_id2', 'scope_id3', ])