22
33from robotlibcore import RF31 , KeywordBuilder
44from moc_library import MockLibrary
5- from moc_library_py3 import MockLibraryPy3
65from DynamicTypesAnnotationsLibrary import DynamicTypesAnnotationsLibrary
76
87
@@ -11,11 +10,6 @@ def lib():
1110 return MockLibrary ()
1211
1312
14- @pytest .fixture
15- def lib_py3 ():
16- return MockLibraryPy3 ()
17-
18-
1913@pytest .fixture
2014def dyn_types ():
2115 return DynamicTypesAnnotationsLibrary (1 )
@@ -67,20 +61,20 @@ def test_varargs_and_kwargs(lib):
6761 assert spec .argument_specification == ['*vargs' , '**kwargs' ]
6862
6963
70- def test_named_only (lib_py3 ):
71- spec = KeywordBuilder .build (lib_py3 .named_only )
64+ def test_named_only (lib ):
65+ spec = KeywordBuilder .build (lib .named_only )
7266 assert spec .argument_specification == ['*varargs' , 'key1' , 'key2' ]
7367
7468
7569@pytest .mark .skipif (RF31 , reason = 'Only for RF3.2+' )
76- def test_named_only_rf32 (lib_py3 ):
77- spec = KeywordBuilder .build (lib_py3 .named_only_with_defaults )
70+ def test_named_only_rf32 (lib ):
71+ spec = KeywordBuilder .build (lib .named_only_with_defaults )
7872 assert spec .argument_specification == ['*varargs' , 'key1' , 'key2' , ('key3' , 'default1' ), ('key4' , True )]
7973
8074
8175@pytest .mark .skipif (not RF31 , reason = 'Only for RF3.1' )
82- def test_named_only_rf31 (lib_py3 ):
83- spec = KeywordBuilder .build (lib_py3 .named_only_with_defaults )
76+ def test_named_only_rf31 (lib ):
77+ spec = KeywordBuilder .build (lib .named_only_with_defaults )
8478 assert spec .argument_specification == ['*varargs' , 'key1' , 'key2' , 'key3=default1' , 'key4=True' ]
8579
8680
@@ -94,18 +88,18 @@ def test_types_disabled_in_keyword_deco(lib):
9488 assert spec .argument_types is None
9589
9690
97- def test_types_ (lib_py3 ):
98- spec = KeywordBuilder .build (lib_py3 .args_with_type_hints )
91+ def test_types_ (lib ):
92+ spec = KeywordBuilder .build (lib .args_with_type_hints )
9993 assert spec .argument_types == {'arg3' : str , 'arg4' : type (None )}
10094
10195
102- def test_types (lib_py3 ):
103- spec = KeywordBuilder .build (lib_py3 .self_and_keyword_only_types )
96+ def test_types (lib ):
97+ spec = KeywordBuilder .build (lib .self_and_keyword_only_types )
10498 assert spec .argument_types == {'varargs' : int , 'other' : bool , 'kwargs' : int }
10599
106100
107- def test_optional_none (lib_py3 ):
108- spec = KeywordBuilder .build (lib_py3 .optional_none )
101+ def test_optional_none (lib ):
102+ spec = KeywordBuilder .build (lib .optional_none )
109103 assert spec .argument_types == {'arg1' : str , 'arg2' : str }
110104
111105
0 commit comments