Emits unexpected behavior error.
(
detail: str, api: CheckerPluginInterface | SemanticAnalyzerPluginInterface, context: Context
)
| 1281 | |
| 1282 | |
| 1283 | def 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 | |
| 1294 | def error_untyped_fields(api: SemanticAnalyzerPluginInterface, context: Context) -> None: |
no test coverage detected