Skip to content

Commit bcbdcde

Browse files
committed
RF 4.0.1 fix
1 parent 0088e4d commit bcbdcde

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

atest/DynamicTypesLibrary.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import functools
22
import sys
33

4+
from robot import version as rf_version
5+
46
from robotlibcore import DynamicCore, keyword
57

68

@@ -61,6 +63,10 @@ def keyword_none(self, arg=None):
6163
def is_python_3_10(self):
6264
return sys.version_info >= (3, 10)
6365

66+
@keyword
67+
def is_rf_401(self):
68+
return "4.0." in rf_version.VERSION
69+
6470
@keyword
6571
@def_deco
6672
def keyword_with_def_deco(self):

atest/tests_types.robot

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,19 @@ Python 3.10 New Type Hints
9696
[Tags] py310
9797
[Setup] Import DynamicTypesAnnotationsLibrary In Python 3.10 Only
9898
${types} = Python310 Style 111
99+
${rf401} = DynamicTypesLibrary.Is Rf 401
100+
IF ${rf401} != ${True}
101+
Should Be Equal ${types} arg: 111, type: <class 'int'>
102+
ELSE
103+
Should Be Equal ${types} arg: 111, type: <class 'str'>
104+
END
99105
Should Be Equal ${types} arg: 111, type: <class 'int'>
100106
${types} = Python310 Style {"key": 1}
101107
Should Be Equal ${types} arg: {'key': 1}, type: <class 'dict'>
102108

103109
*** Keywords ***
104110
Import DynamicTypesAnnotationsLibrary In Python 3.10 Only
105111
${py3} = DynamicTypesLibrary.Is Python 3 10
106-
Run Keyword If ${py3}
107-
... Import Library Python310Library.py
112+
IF ${py3}
113+
Import Library Python310Library.py
114+
END

0 commit comments

Comments
 (0)