MCPcopy Index your code
hub / github.com/python/cpython / update_test_data

Function update_test_data

Lib/test/test_zoneinfo/data/update_test_data.py:102–118  ·  view source on GitHub ↗
(fname: str = "zoneinfo_data.json")

Source from the content-addressed store, hash-verified

100
101
102def update_test_data(fname: str = "zoneinfo_data.json") -> None:
103 TEST_DATA_LOC.mkdir(exist_ok=True, parents=True)
104
105 # Annotation required: https://github.com/python/mypy/issues/8772
106 json_kwargs: typing.Dict[str, typing.Any] = dict(
107 indent=2, sort_keys=True,
108 )
109
110 compressed_keys = load_compressed_keys()
111 metadata = get_zoneinfo_metadata()
112 output = {
113 "metadata": metadata,
114 "data": compressed_keys,
115 }
116
117 with open(TEST_DATA_LOC / fname, "w") as f:
118 json.dump(output, f, **json_kwargs)
119
120
121if __name__ == "__main__":

Callers 1

Calls 5

load_compressed_keysFunction · 0.85
get_zoneinfo_metadataFunction · 0.85
openFunction · 0.50
mkdirMethod · 0.45
dumpMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…