lebrice / SimpleParsing

Simple, Elegant, Typed Argument Parsing with argparse
MIT License
410 stars 52 forks source link

test_decorator failure for Python 3.11.4 #269

Closed zhiruiluo closed 1 year ago

zhiruiluo commented 1 year ago

Describe the bug test_decorator.py failed during collection for Python 3.11.4 at line 65.

>> signature = signature.replace(parameters=new_parameters)  
test/test_decorator.py:86: in <module>
    ("--b=2", 4, partial(_fn_with_all_argument_types, 1, c=1)),
test/test_decorator.py:66: in partial
    signature = signature.replace(parameters=new_parameters)
conda/envs/py311test/lib/python3.11/inspect.py:3052: in replace
    return type(self)(parameters,
.conda/envs/py311test/lib/python3.11/inspect.py:3008: in __init__
    raise ValueError(msg)
E   ValueError: non-default argument follows default argument
---------------------------------------------------------------

The test case ("--b=2", 4, partial(_fn_with_all_argument_types, 1, c=1)), has parameters [<Parameter "a: int = 1">, <Parameter "b: int">, <Parameter "c: int = 1">]

To Reproduce

pytest test/test_decorator.py

Desktop (please complete the following information):

Additional context Add any other context about the problem here.