Bug fix: core.python.arguments.PythonASTArgumentsListParser.to_argument_list failed if a type annotation is not a single name

This commit is contained in:
2026-04-11 15:56:14 +02:00
parent 29714798f7
commit d8fd2b1948
2 changed files with 6 additions and 5 deletions
@@ -32,6 +32,7 @@ def argument_list(argument_list: str) -> ast.arguments:
@pytest.mark.parametrize('ast_arguments_list,expected', [
(argument_list('a'), [PythonFunctionArgument('a', PythonArgumentKind.NORMAL, None, None)]),
(argument_list('a: str'), [PythonFunctionArgument('a', PythonArgumentKind.NORMAL, None, 'str')]),
(argument_list('a: str | int'), [PythonFunctionArgument('a', PythonArgumentKind.NORMAL, None, 'str | int')]),
(argument_list('a: str, b'), [
PythonFunctionArgument('a', PythonArgumentKind.NORMAL, None, 'str'),
PythonFunctionArgument('b', PythonArgumentKind.NORMAL, None, None)