Skip to content

Commit 65140bd

Browse files
Ryanf55henrygerardmoore
authored andcommitted
Combine constant tests in a loop
Co-authored-by: Henry Moore <[email protected]> Signed-off-by: Ryan <[email protected]>
1 parent 46f608f commit 65140bd

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

rosidl_adapter/test/test_constant.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,9 @@ def test_constant_constructor():
3131
Constant('bool', 'FOO', None)
3232

3333
# NaN is case insensitive in python, so test a few variations.
34-
value = Constant('float32', 'FOO', 'nan')
35-
value = Constant('float32', 'FOO', 'Nan')
36-
value = Constant('float32', 'FOO', 'NaN')
37-
value = Constant('float32', 'FOO', 'NAN')
38-
value = Constant('float64', 'FOO', 'nan')
39-
value = Constant('float64', 'FOO', 'Nan')
40-
value = Constant('float64', 'FOO', 'NaN')
41-
value = Constant('float64', 'FOO', 'NAN')
34+
for nan_string in ['nan','Nan','NaN','NAN','nan','Nan','NaN','NAN']:
35+
value = Constant('float32', 'FOO', nan_string)
36+
assert isnan(value.value)
4237

4338

4439
def test_constant_methods():

0 commit comments

Comments
 (0)