After migrating a Python application from 2.6 to 2.7 I have learned from my pytest results that the order of a list has changed. The content of the list is the result of a third party openLDAP library.
This is the list in Python 2.6:
assert ['1', '2', '8'] == ['1', '2', '8']
But with Python 2.7 the order of the list has changed, which results in a AssertionError
:
assert ['1', '8', '2'] == ['1', '2', '8']
What is the best advice, to change the implementation to get ordered lists, or change the test i.e. by converting all lists to a set
for comparing the assert result in a stable way?