Skip to content

Commit a01fad1

Browse files
More test fixes
1 parent 55d0f5b commit a01fad1

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

test/test_sam_annotator/test_widgets.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
import json
22
import os
33
import platform
4+
import warnings
45

5-
from mobile_sam.predictor import SamPredictor as MobileSamPredictor
6+
# Avoid import warnigns from mobile_sam
7+
with warnings.catch_warnings():
8+
warnings.simplefilter("ignore")
9+
from mobile_sam.predictor import SamPredictor as MobileSamPredictor
610
from segment_anything.predictor import SamPredictor
711
import numpy as np
812
import pytest
@@ -33,8 +37,11 @@ def test_embedding_widget(make_napari_viewer, tmp_path):
3337
my_widget.embeddings_save_path = tmp_path
3438

3539
# Run image embedding widget.
36-
worker = my_widget(skip_validate=True)
37-
worker.await_workers() # blocks until thread worker is finished the embedding
40+
my_widget(skip_validate=True)
41+
42+
# Previous version when we used a thread-worker
43+
# worker = my_widget(skip_validate=True)
44+
# worker.await_workers() # blocks until thread worker is finished the embedding
3845

3946
# Check in-memory state for predictor and embeddings.
4047
assert isinstance(AnnotatorState().predictor, (SamPredictor, MobileSamPredictor))

0 commit comments

Comments
 (0)