2
2
3
3
from robotlibcore import RF31 , KeywordBuilder
4
4
from moc_library import MockLibrary
5
- from moc_library_py3 import MockLibraryPy3
6
5
from DynamicTypesAnnotationsLibrary import DynamicTypesAnnotationsLibrary
7
6
8
7
@@ -11,11 +10,6 @@ def lib():
11
10
return MockLibrary ()
12
11
13
12
14
- @pytest .fixture
15
- def lib_py3 ():
16
- return MockLibraryPy3 ()
17
-
18
-
19
13
@pytest .fixture
20
14
def dyn_types ():
21
15
return DynamicTypesAnnotationsLibrary (1 )
@@ -67,20 +61,20 @@ def test_varargs_and_kwargs(lib):
67
61
assert spec .argument_specification == ['*vargs' , '**kwargs' ]
68
62
69
63
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 )
72
66
assert spec .argument_specification == ['*varargs' , 'key1' , 'key2' ]
73
67
74
68
75
69
@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 )
78
72
assert spec .argument_specification == ['*varargs' , 'key1' , 'key2' , ('key3' , 'default1' ), ('key4' , True )]
79
73
80
74
81
75
@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 )
84
78
assert spec .argument_specification == ['*varargs' , 'key1' , 'key2' , 'key3=default1' , 'key4=True' ]
85
79
86
80
@@ -94,18 +88,18 @@ def test_types_disabled_in_keyword_deco(lib):
94
88
assert spec .argument_types is None
95
89
96
90
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 )
99
93
assert spec .argument_types == {'arg3' : str , 'arg4' : type (None )}
100
94
101
95
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 )
104
98
assert spec .argument_types == {'varargs' : int , 'other' : bool , 'kwargs' : int }
105
99
106
100
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 )
109
103
assert spec .argument_types == {'arg1' : str , 'arg2' : str }
110
104
111
105
0 commit comments