MCPcopy Index your code
hub / github.com/msgspec/msgspec / test_replace_unknown_field

Method test_replace_unknown_field

tests/unit/test_struct.py:2304–2307  ·  view source on GitHub ↗
(self, replace)

Source from the content-addressed store, hash-verified

2302 assert replace(p, x=3, y=4) == Point(3, 4)
2303
2304 def test_replace_unknown_field(self, replace):
2305 p = Point(1, 2)
2306 with pytest.raises(TypeError, match="`Point` has no field 'oops'"):
2307 replace(p, oops=3)
2308
2309 def test_replace_errors_unset_fields(self, replace):
2310 p = Point(1, 2)

Callers

nothing calls this directly

Calls 2

replaceFunction · 0.85
PointClass · 0.70

Tested by

no test coverage detected