Skip to content

Commit bdfb806

Browse files
fix(test): guard dict() cast in structured_entry to fix mypy arg-type error
1 parent d482cb6 commit bdfb806

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tests/test_parser_fuzz.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ def structured_entry(draw: st.DrawFn) -> dict:
117117
entry = dict(_minimal_assistant)
118118
entry.update(base)
119119
if draw(st.booleans()):
120-
msg = dict(entry.get("message", {}))
120+
msg_val = entry.get("message", {})
121+
msg = dict(msg_val) if isinstance(msg_val, dict) else {}
121122
if draw(st.booleans()):
122123
msg["usage"] = draw(
123124
st.one_of(st.text(), st.integers(), st.dictionaries(st.text(), _json_value))

0 commit comments

Comments
 (0)