-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
good first issueeasy issue that is friendly to new contributoreasy issue that is friendly to new contributorplugin: cacherelated to the cache builtin pluginrelated to the cache builtin plugin
Description
I'm running into an issue where I'm losing the sort order of a dict object when storing it with the config.cache:
request.config.cache.set('foo', {'b':1,'a':2})
print(request.config.cache.get('foo', None))Returns:
{'a': 2, 'b': 1}
This issue is caused by the sort_keys parameter here:
pytest/src/_pytest/cacheprovider.py
Line 196 in 5fc7b21
| data = json.dumps(value, indent=2, sort_keys=True) |
I'm assuming this was written with Python 2.x in mind, but now that Python 3.x dict is sorted this is causing an issue. Could this be removed so that sort order is maintained?
Metadata
Metadata
Assignees
Labels
good first issueeasy issue that is friendly to new contributoreasy issue that is friendly to new contributorplugin: cacherelated to the cache builtin pluginrelated to the cache builtin plugin