[issue24928] mock.patch.dict spoils order of items in collections.OrderedDict

Karthikeyan Singaravelan report at bugs.python.org
Thu Dec 27 00:39:57 EST 2018


Karthikeyan Singaravelan <tir.karthi at gmail.com> added the comment:

Hi Vaibhav,

As noted in the thread the issue is fixed in 3.6 and above due to dict order being guaranteed. But it would be nice to have the test in the patch converted as a unit test. With respect to backport the fixes are backported to https://github.com/testing-cabal/mock to make mock library available for older versions of Python which would required the fix since dict order is not guaranteed in older versions. Once the test to CPython is merged you can make a PR to the mock repo with the fix and the test.

I haven't started working on a PR for this so feel free to go ahead.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue24928>
_______________________________________


More information about the Python-bugs-list mailing list