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: I6ebd93aa093caad6f2d3db6e43beb8bc8d9cedb7
This commit is contained in:
Dirk Mueller 2021-02-16 10:29:21 +01:00
parent c3bda9eeb1
commit b4c39c5874
1 changed files with 1 additions and 1 deletions

View File

@ -174,7 +174,7 @@ class TestStrings(yaql.tests.TestCase):
self.assertEqual(['a', 'b', 'c'], self.eval('abc.toCharArray()'))
def test_characters(self):
self.assertItemsEqual(
self.assertCountEqual(
['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
self.eval('characters(octdigits => true, digits => true)'))