Skip to content

Commit

Permalink
Minor test speed-ups.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmeyer committed Dec 30, 2024
1 parent fb8e590 commit 4ace6fb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions nion/instrumentation/test/ScanControl_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,9 @@ def test_enabling_channel_during_acquisition_results_in_write_delayed_data_item(
scan_hardware_source = test_context.scan_hardware_source
scan_hardware_source.set_channel_enabled(0, True)
frame_time = scan_hardware_source.get_current_frame_time()
scan_hardware_source.start_playing()
scan_hardware_source.start_playing(sync_timeout=3.0)
try:
time.sleep(frame_time * 2.1)
time.sleep(frame_time * 1.2)
test_context.document_controller.periodic()
self.assertEqual(1, len(test_context.document_model.data_items))
self.assertTrue(test_context.document_model.data_items[0].is_write_delayed)
Expand Down Expand Up @@ -770,16 +770,16 @@ def test_consecutive_frames_have_unique_data(self):
with self._test_context() as test_context:
scan_hardware_source = test_context.scan_hardware_source
frame_parameters_0 = scan_hardware_source.get_frame_parameters(0)
frame_parameters_0.size = Geometry.IntSize(256, 256)
frame_parameters_0.size = Geometry.IntSize(16, 16)
frame_parameters_0.pixel_time_us = 2
scan_hardware_source.set_frame_parameters(0, frame_parameters_0)
scan_hardware_source.start_playing()
data_list = list()
for i in range(16):
for i in range(6):
data = scan_hardware_source.get_next_xdatas_to_finish()[0].data
data_list.append(data)
for row in range(0, 256, 32):
s = slice(row, row+32), slice(0, 256)
for row in range(0, len(data_list)):
s = slice(row, row+1), slice(0, 16)
for i, data in enumerate(data_list[1:]):
self.assertFalse(numpy.array_equal(data_list[0][s], data[s]))
finally:
Expand Down

0 comments on commit 4ace6fb

Please sign in to comment.