From 6c094dbb3ca4445e743acb48df8c46baf22f559e Mon Sep 17 00:00:00 2001 From: melissaml Date: Sun, 5 Jul 2020 19:38:34 +0800 Subject: [PATCH] Switch from unittest2 compat methods to Python 3.x methods With the removal of Python 2.x we can remove the unittest2 compat wrappers and switch to assertCountEqual instead of assertItemsEqual 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: If5dc6ebffc7b4f031b0350a4fe77a660a1e7becf --- .../services/bgp/scheduler/test_bgp_dragent_scheduler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neutron_dynamic_routing/tests/functional/services/bgp/scheduler/test_bgp_dragent_scheduler.py b/neutron_dynamic_routing/tests/functional/services/bgp/scheduler/test_bgp_dragent_scheduler.py index 0f0fb1c0..25ae59b6 100644 --- a/neutron_dynamic_routing/tests/functional/services/bgp/scheduler/test_bgp_dragent_scheduler.py +++ b/neutron_dynamic_routing/tests/functional/services/bgp/scheduler/test_bgp_dragent_scheduler.py @@ -199,7 +199,7 @@ class TestAutoSchedule(testlib_api.SqlTestCase, for net in hosted_bgp_speakers] expected_hosted_bgp_speakers = self.expected_hosted_bgp_speakers[ 'agent-%s' % host_index] - self.assertItemsEqual(hosted_bs_ids, expected_hosted_bgp_speakers, + self.assertCountEqual(hosted_bs_ids, expected_hosted_bgp_speakers, msg) def test_auto_schedule(self):