From 941eb8a52a6decc9fff8064987290a98f389746d Mon Sep 17 00:00:00 2001 From: Antony Milne Date: Thu, 23 Nov 2023 13:49:02 +0000 Subject: [PATCH] Fix imports in test_types --- vizro-core/tests/unit/vizro/models/test_types.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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: