MCPcopy
hub / github.com/pydantic/pydantic / _north_star_data_bytes

Function _north_star_data_bytes

tests/benchmarks/test_north_star.py:73–83  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

71
72
73def _north_star_data_bytes() -> bytes:
74 from .generate_north_star_data import person_data
75
76 needs_generating = not _NORTH_STAR_DATA_PATH.exists()
77 if needs_generating:
78 data = json.dumps(person_data(length=1000)).encode()
79 _NORTH_STAR_DATA_PATH.write_bytes(data)
80 else:
81 data = _NORTH_STAR_DATA_PATH.read_bytes()
82
83 return data
84
85
86def test_north_star_validate_json(pydantic_type_adapter, north_star_data_bytes, benchmark):

Callers 1

north_star_data_bytesFunction · 0.85

Calls 2

person_dataFunction · 0.85
encodeMethod · 0.45

Tested by

no test coverage detected