MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / test_keyword_only_param

Function test_keyword_only_param

tests/test_required_args.py:30–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28
29
30def test_keyword_only_param() -> None:
31 @required_args(["a"])
32 def foo(*, a: str | None = None) -> str | None:
33 return a
34
35 assert foo(a="a") == "a"
36 assert foo(a=None) is None
37 assert foo(a="b") == "b"
38
39 with pytest.raises(TypeError, match="Missing required argument: 'a'"):
40 foo()
41
42
43def test_multiple_params() -> None:

Callers

nothing calls this directly

Calls 1

fooFunction · 0.85

Tested by

no test coverage detected