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.

python
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.

python
@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.

python
case(name, *, given, returns=... | raises=..., match=None, desc="")

run_tests

指定関数、または登録済みの全関数を実行し、RunResultを返します。失敗結果は例外ではなく構造化データとして保持します。

python
run_tests(*functions) -> RunResult

conforms_to

Create an expectation from any Pydantic-compatible type annotation. It validates real results and is never used as a fixed mock.

python
conforms_to(type_hint, *, strict=False) -> TypeExpectation

register_locale

完全なメッセージカタログを登録します。既存言語の置換にはoverwrite=Trueが必要です。

python
register_locale(locale, messages, *, overwrite=False)