I was working on a customised error message when I came across an issue using:
pytest.raises(error, match=f'error_message_part1 {set1 - set2} error_message_part2')
Basically, I don't understand how the ordering of the result between set1 and set2 works. There seems to be an ordering even though the documentation as far as I went through it says otherwise. I am working with python 3.9.10
I am interested in understanding how the 'sorting' of the result works.
Here is the simple example that highlighted the issue:
>>> a = {'a', 'b', 'c', 'd', 'e'}
>>> b = {'b', 'd'}
>>> a - b
{'e', 'a', 'c'}
>>> a = {'c', 'b', 'a', 'd', 'e'}
>>> a - b
{'e', 'a', 'c'}
>>> a = {'e', 'b', 'a', 'd', 'c'}
>>> a - b
{'e', 'a', 'c'}