1- from typing import List , Iterator , Optional , Literal , TypeVar , Generic , Type , Union , cast
1+ from typing import (
2+ List ,
3+ Iterator ,
4+ Optional ,
5+ Literal ,
6+ TypeVar ,
7+ Generic ,
8+ Type ,
9+ Union ,
10+ cast ,
11+ )
212from enum import Enum
313from dataclasses import dataclass
414import pytest
@@ -137,8 +147,7 @@ def test_cli_required():
137147 cli = Radicli ()
138148
139149 @cli .command ("test" , a = Arg (), b = Arg ("--b" ), c = Arg ("--c" ), d = Arg ("--d" ))
140- def test (a : str , b : str , c : int , d : int = 0 ):
141- ...
150+ def test (a : str , b : str , c : int , d : int = 0 ): ...
142151
143152 with pytest .raises (CliParserError ) as err :
144153 cli .run (["" , "test" , "hello" , "--c" , "1" ])
@@ -256,8 +265,7 @@ def converter(value):
256265 raise TypeError (error_msg )
257266
258267 @cli .command ("test" , a = Arg ("--a" , converter = converter ))
259- def test (a : str ):
260- ...
268+ def test (a : str ): ...
261269
262270 with pytest .raises (CliParserError , match = error_msg ):
263271 cli .run (["" , "test" , "--a" , "hello" ])
@@ -306,8 +314,7 @@ def test(a: str, b: List[str], c: CustomType):
306314_KindT = TypeVar ("_KindT" , bound = Union [str , int , float , Path ])
307315
308316
309- class CustomGeneric (Generic [_KindT ]):
310- ...
317+ class CustomGeneric (Generic [_KindT ]): ...
311318
312319
313320def test_cli_converters_generics ():
@@ -328,8 +335,7 @@ def test(a: CustomGeneric[str]):
328335def test_cli_converters_generics_multiple ():
329336 _KindT = TypeVar ("_KindT" )
330337
331- class CustomGeneric (Generic [_KindT ]):
332- ...
338+ class CustomGeneric (Generic [_KindT ]): ...
333339
334340 converters = {
335341 CustomGeneric : lambda value : f"generic: { value } " ,
@@ -917,8 +923,8 @@ def convert_generic(value: str) -> str:
917923def test_static_default_serialization ():
918924 cli = Radicli (prog = "test" )
919925
920- @cli .command ("test" , a = Arg ("--a" , short = '-a' ))
921- def _ (a : List [str ]= []):
926+ @cli .command ("test" , a = Arg ("--a" , short = "-a" ))
927+ def _ (a : List [str ] = []):
922928 """Hello"""
923929
924930 with make_tempdir () as dir_path :
@@ -1012,8 +1018,7 @@ def test_cli_booleans():
10121018 b = Arg ("--b" ),
10131019 c = Arg ("--c" ),
10141020 )
1015- def test (a : bool , b : bool = False , c : bool = True ):
1016- ...
1021+ def test (a : bool , b : bool = False , c : bool = True ): ...
10171022
10181023 args = ["--a" , "--b" , "--c" ]
10191024 parsed = cli .parse (args , cli .commands ["test" ])
0 commit comments