From 0d0b1a18214a250e68beaea859fcd31aa87366f3 Mon Sep 17 00:00:00 2001 From: JO Hiroyuki Date: Fri, 27 Mar 2020 23:21:56 +0900 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] - https://github.com/testing-cabal/testtools/issues/286 [4] - https://github.com/testing-cabal/testtools/pull/277 Change-Id: I53f758e7e8870b43b675f4c63d986f07d199c259 --- translator/tests/test_translate_node_template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translator/tests/test_translate_node_template.py b/translator/tests/test_translate_node_template.py index 7bddb08b..8061ee51 100644 --- a/translator/tests/test_translate_node_template.py +++ b/translator/tests/test_translate_node_template.py @@ -42,4 +42,4 @@ class TranslateNodeTemplatesTest(TestCase): ] actual_type_list = list(_generate_type_map()) - self.assertItemsEqual(expected_type_list, actual_type_list) + self.assertCountEqual(expected_type_list, actual_type_list)