MCPcopy
hub / github.com/pydantic/pydantic / install_plugin

Function install_plugin

tests/test_plugins.py:26–31  ·  view source on GitHub ↗
(plugin: PydanticPluginProtocol)

Source from the content-addressed store, hash-verified

24
25@contextlib.contextmanager
26def install_plugin(plugin: PydanticPluginProtocol) -> Generator[None, None, None]:
27 _plugins[plugin.__class__.__qualname__] = plugin
28 try:
29 yield
30 finally:
31 _plugins.clear()
32
33
34def test_on_validate_json_on_success() -> None:

Calls 1

clearMethod · 0.80

Tested by

no test coverage detected