Skip to content

Commit d0528fa

Browse files
Do minor testware updates
1 parent e493f80 commit d0528fa

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

tests/test_record_values.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,9 @@ def run_ioc(record_configurations: list, conn, set_enum, get_enum):
317317
) = configuration
318318

319319
if set_enum == SetValueEnum.INITIAL_VALUE:
320-
kwarg.update({"initial_value": initial_value})
320+
kwarg["initial_value"] = initial_value
321321
elif creation_func in [builder.WaveformIn, builder.WaveformOut]:
322-
kwarg = {"length": WAVEFORM_LENGTH} # Must specify when no value
322+
kwarg["length"] = WAVEFORM_LENGTH # Must specify when no value
323323
# Related to this issue:
324324
# https://github.com/dls-controls/pythonSoftIOC/issues/37
325325

@@ -414,7 +414,7 @@ def run_test_function(
414414
kwargs = {}
415415
put_kwarg = {}
416416
if creation_func in [builder.longStringIn, builder.longStringOut]:
417-
kwargs.update({"datatype": DBR_CHAR_STR})
417+
kwargs["datatype"] = DBR_CHAR_STR
418418

419419
if (creation_func in [builder.WaveformIn, builder.WaveformOut]
420420
and type(initial_value) is bytes):
@@ -462,7 +462,7 @@ def run_test_function(
462462
and expected_value.dtype in [numpy.float64, numpy.int32]
463463
):
464464
print(
465-
"caget cannot distinguish between a waveform with 1"
465+
"caget cannot distinguish between a waveform with 1 "
466466
"element and a scalar value, and so always returns a "
467467
"scalar. Therefore we skip this check.")
468468
continue
@@ -774,11 +774,11 @@ def none_value_test_func(self, record_func, queue):
774774
record.set(None)
775775
print("CHILD: Uh-OH! No exception thrown when setting None!")
776776
except Exception as e:
777+
print("CHILD: Putting exception into queue", e)
777778
queue.put(e)
778-
779-
print("CHILD: We really should never get here...")
780-
781-
queue.put(Exception("FAIL:Test did not raise exception during .set()"))
779+
else:
780+
print("CHILD: No exception raised when using None as value!")
781+
queue.put(Exception("FAIL: No exception raised during .set()"))
782782

783783
@requires_cothread
784784
def test_value_none_rejected_set_after_init(self, record_func_reject_none):

tests/test_records.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,10 @@ def validate_ioc_test_func(
173173
if record_func in [builder.WaveformIn, builder.WaveformOut]:
174174
kwarg = {"length": WAVEFORM_LENGTH} # Must specify when no value
175175

176-
kwarg.update(
177-
{
178-
"validate": self.validate_always_pass
179-
if validate_pass
180-
else self.validate_always_fail
181-
}
176+
kwarg["validate"] = (
177+
self.validate_always_pass
178+
if validate_pass
179+
else self.validate_always_fail
182180
)
183181

184182
record_func("VALIDATE-RECORD", **kwarg)

0 commit comments

Comments
 (0)