MCPcopy Index your code
hub / github.com/pytest-dev/pytest / test_preserve_keys_order

Function test_preserve_keys_order

testing/test_cacheprovider.py:1321–1329  ·  view source on GitHub ↗

Ensure keys order is preserved when saving dicts (#9205).

(pytester: Pytester)

Source from the content-addressed store, hash-verified

1319
1320
1321def test_preserve_keys_order(pytester: Pytester) -> None:
1322 """Ensure keys order is preserved when saving dicts (#9205)."""
1323 from _pytest.cacheprovider import Cache
1324
1325 config = pytester.parseconfig()
1326 cache = Cache.for_config(config, _ispytest=True)
1327 cache.set("foo", {"z": 1, "b": 2, "a": 3, "d": 10})
1328 read_back = cache.get("foo", None)
1329 assert list(read_back.items()) == [("z", 1), ("b", 2), ("a", 3), ("d", 10)]
1330
1331
1332def test_does_not_create_boilerplate_in_existing_dirs(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 4

for_configMethod · 0.80
setMethod · 0.80
parseconfigMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…