Skip to content

Commit f7c1519

Browse files
committed
Make sure we skip visual tests if the required dependencies are not installed
1 parent 8cd3092 commit f7c1519

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

glue_jupyter/tests/helpers.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@
33
import pytest
44
from IPython.display import display
55

6+
try:
7+
import solara
8+
import playwright
9+
import pytest_mpl
10+
import pytest_playwright
11+
except ImportError:
12+
HAS_VISUAL_TEST_DEPS = False
13+
else:
14+
HAS_VISUAL_TEST_DEPS = True
15+
616
__all__ = ['visual_widget_test']
717

818

@@ -24,6 +34,7 @@ def visual_widget_test(*args, **kwargs):
2434
tolerance = kwargs.pop("tolerance", 0)
2535

2636
def decorator(test_function):
37+
@pytest.mark.skipif("not HAS_VISUAL_TEST_DEPS")
2738
@pytest.mark.mpl_image_compare(
2839
tolerance=tolerance, **kwargs
2940
)

0 commit comments

Comments
 (0)