configure
Update the production, test, or mock operating mode and output language. Production is the default. Invalid modes and unregistered locales raise ValueError. Call it before importing target modules when changing decorator behavior.
configure(mode: Mode | str | None = None, language=None)scenario
Register a synchronous or asynchronous function as a specification target. In production mode, it returns the original function.
@scenario(title)case / expect.case
Register a name, description, keyword inputs, and either a return expectation or expected exception. returns and raises are mutually exclusive; match is an exception-message regular expression.
case(name, *, given, returns=... | raises=..., match=None, desc="")run_tests
指定関数、または登録済みの全関数を実行し、RunResultを返します。失敗結果は例外ではなく構造化データとして保持します。
run_tests(*functions) -> RunResultconforms_to
Create an expectation from any Pydantic-compatible type annotation. It validates real results and is never used as a fixed mock.
conforms_to(type_hint, *, strict=False) -> TypeExpectationregister_locale
完全なメッセージカタログを登録します。既存言語の置換にはoverwrite=Trueが必要です。
register_locale(locale, messages, *, overwrite=False)