MCPcopy Create free account
hub / github.com/celery/celery / test_get_optional_arg_with_pipe_notation

Function test_get_optional_arg_with_pipe_notation

t/unit/utils/test_annotations.py:49–56  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

47
48@pytest.mark.skipif(sys.version_info < (3, 10), reason="Notation is only supported in Python 3.10 or newer.")
49def test_get_optional_arg_with_pipe_notation() -> None:
50 def func(optional: int | None, optional2: None | int) -> None:
51 pass
52
53 parameters = inspect.signature(func).parameters
54
55 assert get_optional_arg(parameters['optional'].annotation) is int
56 assert get_optional_arg(parameters['optional2'].annotation) is int
57
58
59def test_annotation_issubclass() -> None:

Callers

nothing calls this directly

Calls 2

get_optional_argFunction · 0.90
signatureMethod · 0.45

Tested by

no test coverage detected