|
13 | 13 | from softioc.device_core import RecordLookup |
14 | 14 | import sim_records |
15 | 15 |
|
| 16 | +requires_cothread = pytest.mark.skipif( |
| 17 | + sys.platform.startswith("win"), |
| 18 | + reason="Cothread doesn't work on windows" |
| 19 | + ) |
| 20 | + |
16 | 21 |
|
17 | 22 | def _clear_records(): |
18 | 23 | # Remove any records created at epicsdbbuilder layer |
@@ -154,12 +159,12 @@ def record_value_asserts( |
154 | 159 | else: |
155 | 160 | # Python2 handles UTF-8 differently so needs extra encoding |
156 | 161 | if sys.version_info < (3,) and expected_type == str: |
157 | | - expected_value = expected_value.decode(errors="replace") |
| 162 | + expected_value = expected_value.decode("utf-8", errors="replace") |
158 | 163 |
|
159 | 164 | assert actual_value == expected_value |
160 | 165 | assert type(actual_value) == expected_type |
161 | 166 |
|
162 | | -def test_value_retrieval_pre_init_set( |
| 167 | +def test_value_pre_init_set( |
163 | 168 | clear_records, |
164 | 169 | record_values): |
165 | 170 | """Test that records provide the expected values on get calls when using |
@@ -254,18 +259,21 @@ def run_test_function(record_values, set_enum): |
254 | 259 | process.terminate() |
255 | 260 | process.join(timeout=3) |
256 | 261 |
|
| 262 | +@requires_cothread |
257 | 263 | def test_value_post_init_set(record_values): |
258 | 264 | """Test that records provide the expected values on get calls when using |
259 | 265 | .set() before IOC initialisation and .get() after initialisation""" |
260 | 266 |
|
261 | 267 | run_test_function(record_values, SetValueEnum.SET_BEFORE_INIT) |
262 | 268 |
|
| 269 | +@requires_cothread |
263 | 270 | def test_value_post_init_initial_value(record_values): |
264 | 271 | """Test that records provide the expected values on get calls when using |
265 | 272 | initial_value during record creation and .get() after IOC initialisation""" |
266 | 273 |
|
267 | 274 | run_test_function(record_values, SetValueEnum.INITIAL_VALUE) |
268 | 275 |
|
| 276 | +@requires_cothread |
269 | 277 | def test_value_post_init_set_after_init(record_values): |
270 | 278 | """Test that records provide the expected values on get calls when using |
271 | 279 | .set() and .get() after IOC initialisation""" |
|
0 commit comments