Fix a unit test issue with dictionary sort order on Python 3.5.

Review Request #11137 — Created Aug. 12, 2020 and submitted — Latest diff uploaded

Information

kgb
master

Reviewers

kgb

On Python 3.5, the assertSpyCalledWith() unit test was comparing
assertion errors that involved the order of keys in a dictionary. All
versions of Python happened to have the same order, with the exception
of Python 3.5.

There was an attempt at sorting, but it wasn't done correctly. Keys were
being sorted and then put back into a dictionary, which was unsorted. So
now we don't do this. Instead, a string representation of a dictionary
is built, with the key/value pairs built as a string, using the sorted
keys.

Unit tests pass for all versions of Python.

Commits

Files