The Python Oracle

How to assert two list contain the same elements in Python?

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Unforgiving Himalayas Looping

--

Chapters
00:00 Question
00:49 Accepted answer (Score 249)
02:10 Answer 2 (Score 60)
02:41 Answer 3 (Score 39)
03:21 Answer 4 (Score 20)
04:06 Thank you

--

Full question
https://stackoverflow.com/questions/1281...

Question links:
[TestCase.assertItemsEqual]: http://docs.python.org/library/unittest....
[unittest2]: http://pypi.python.org/pypi/unittest2

Accepted answer links:
[doc]: https://docs.python.org/2/library/unitte...
[doc]: https://docs.python.org/3.2/library/unit...
[standard library documentation]: https://docs.python.org/3.2/library/unit...

Answer 3 links:
[In Python ]: http://docs.python.org/3/library/unittes...
[In Python ]: http://docs.python.org/library/unittest....
[In Python ]: https://pypi.python.org/pypi/unittest2
[Via ]: https://six.readthedocs.io/#six.assertCo...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #unittesting

#avk47