MCPcopy
hub / github.com/pydantic/pydantic / error_unexpected_behavior

Function error_unexpected_behavior

pydantic/mypy.py:1283–1291  ·  view source on GitHub ↗

Emits unexpected behavior error.

(
    detail: str, api: CheckerPluginInterface | SemanticAnalyzerPluginInterface, context: Context
)

Source from the content-addressed store, hash-verified

1281
1282
1283def error_unexpected_behavior(
1284 detail: str, api: CheckerPluginInterface | SemanticAnalyzerPluginInterface, context: Context
1285) -> None: # pragma: no cover
1286 """Emits unexpected behavior error."""
1287 # Can't think of a good way to test this, but I confirmed it renders as desired by adding to a non-error path
1288 link = 'https://github.com/pydantic/pydantic/issues/new/choose'
1289 full_message = f'The pydantic mypy plugin ran into unexpected behavior: {detail}\n'
1290 full_message += f'Please consider reporting this bug at {link} so we can try to fix it!'
1291 api.fail(full_message, context, code=ERROR_UNEXPECTED)
1292
1293
1294def error_untyped_fields(api: SemanticAnalyzerPluginInterface, context: Context) -> None:

Callers 1

from_attributes_callbackFunction · 0.70

Calls 1

failMethod · 0.80

Tested by

no test coverage detected