diff --git a/vizro-core/tests/unit/vizro/models/test_types.py b/vizro-core/tests/unit/vizro/models/test_types.py index 3315d2654..0d7042ec7 100644 --- a/vizro-core/tests/unit/vizro/models/test_types.py +++ b/vizro-core/tests/unit/vizro/models/test_types.py @@ -1,3 +1,6 @@ +import importlib +from pathlib import Path + import plotly.express as plotly_express import plotly.graph_objects as go import pytest @@ -145,7 +148,7 @@ def invalid_decorated_graph_function(): class Model(VizroBaseModel): # The import_path here makes it possible to import the above function using getattr(import_path, _target_). - function: CapturedCallable = Field(..., import_path=__import__(__name__)) + function: CapturedCallable = Field(..., import_path=importlib.import_module(__name__)) class TestModelFieldPython: