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

Function test_positional_param

tests/test_required_args.py:17–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15
16
17def test_positional_param() -> None:
18 @required_args(["a"])
19 def foo(a: str | None = None) -> str | None:
20 return a
21
22 assert foo("a") == "a"
23 assert foo(None) is None
24 assert foo(a="b") == "b"
25
26 with pytest.raises(TypeError, match="Missing required argument: 'a'"):
27 foo()
28
29
30def test_keyword_only_param() -> None:

Callers

nothing calls this directly

Calls 1

fooFunction · 0.85

Tested by

no test coverage detected