Skip to content

Commit

Permalink
expected_log_messages should be a subset of captured messages
Browse files Browse the repository at this point in the history
Co-authored-by: Chang Huan Lo <changhuan.lo@ucl.ac.uk>
  • Loading branch information
niksirbi and lochhh authored Nov 19, 2024
1 parent 2ce361c commit f92245e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/test_unit/test_napari_plugin/test_poses_loader_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,15 @@ def test_on_load_clicked_with_valid_file_path(
assert poses_loader_widget.props is not None

# Check that the expected log messages were emitted
expected_log_messages = [
# Check that the expected log messages were emitted
expected_log_messages = {
"Converted poses dataset to a napari Tracks array.",
"Tracks array shape: ",
"Tracks array shape: (2170, 4)",
"Added poses dataset as a napari Points layer.",
"Set napari playback speed to ",
]
for msg in expected_log_messages:
assert any(msg in record.getMessage() for record in caplog.records)
"Set napari playback speed to 60 fps.",
}
log_messages = {record.getMessage() for record in caplog.records}
assert expected_log_messages <= log_messages

# Check that a Points layer was added to the viewer
points_layer = poses_loader_widget.viewer.layers[0]
Expand Down

0 comments on commit f92245e

Please sign in to comment.