Use metavar to list the choices for a CLI arg when custom values are also accepted (#21760)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
@@ -72,6 +72,10 @@ def test_get_type(type_hints, type, expected):
|
||||
"type": int,
|
||||
"choices": [1, 2]
|
||||
}),
|
||||
({str, Literal["x", "y"]}, {
|
||||
"type": str,
|
||||
"metavar": ["x", "y"]
|
||||
}),
|
||||
({Literal[1, "a"]}, Exception),
|
||||
])
|
||||
def test_literal_to_kwargs(type_hints, expected):
|
||||
|
||||
Reference in New Issue
Block a user