diff --git a/pyproject.toml b/pyproject.toml index 31cad4d72..1af7b8978 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,6 +40,7 @@ test_thirdparty = [ "PyQt6==6.8.1", "numba>=0.60", "plotly", + "psygnal", "pydantic-extra-types>=2,!=2.10.1", "pydantic", "pygfx", diff --git a/tests/test_model_fields.py b/tests/test_model_fields.py index c3e63a670..d8e1bc694 100644 --- a/tests/test_model_fields.py +++ b/tests/test_model_fields.py @@ -6,10 +6,7 @@ from cmap import Color, Colormap from cmap._colormap import ColorStops -try: - from pydantic import BaseModel -except ImportError: - pytest.skip("pydantic not installed", allow_module_level=True) +pydantic = pytest.importorskip("pydantic", minversion="2") def test_pydantic_casting() -> None: @@ -18,7 +15,7 @@ def test_pydantic_casting() -> None: def test_pydantic_validate() -> None: - class MyModel(BaseModel): + class MyModel(pydantic.BaseModel): color: Color colormap: Colormap