Skip to content

Commit c57e1f1

Browse files
Allow record_value_asserts to run on Windows
cothread isn't on Windows, but we still want to run some tests there
1 parent cea2448 commit c57e1f1

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

tests/test_records.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,12 @@ def run_test_function(
378378
timeout=TIMEOUT,
379379
**get_kwargs)
380380

381+
from cothread.dbr import ca_float, ca_array, ca_str, ca_int
382+
if type(rec_val) in (ca_float, ca_array, ca_str, ca_int):
383+
# '+' is used to convert values returned from cothread, which
384+
# are AugmentedValues, back into their Python native forms
385+
rec_val = +rec_val
386+
381387

382388
record_value_asserts(
383389
creation_func,
@@ -397,13 +403,6 @@ def record_value_asserts(
397403
expected_type):
398404
"""Asserts that the expected value and expected type are matched with
399405
the actual value. Handles both scalar and waveform data"""
400-
from cothread.dbr import ca_float, ca_array, ca_str, ca_int
401-
if type(actual_value) in (ca_float, ca_array, ca_str, ca_int):
402-
# '+' is used to convert values returned from cothread, which are
403-
# AugmentedValues, back into their Python native forms
404-
actual_value = +actual_value
405-
406-
407406
if type(expected_value) == float and isnan(expected_value):
408407
assert isnan(actual_value) # NaN != Nan, so needs special case
409408
elif creation_func in [builder.WaveformOut, builder.WaveformIn]:

0 commit comments

Comments
 (0)