From 49c59f1a4b2182cd86f65934f9b1c76a118c7917 Mon Sep 17 00:00:00 2001 From: Andrew Huang Date: Fri, 25 Oct 2024 17:46:24 -0700 Subject: [PATCH] add try/except --- lumen/tests/ai/test_export.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lumen/tests/ai/test_export.py b/lumen/tests/ai/test_export.py index bc055630..a0ad09a3 100644 --- a/lumen/tests/ai/test_export.py +++ b/lumen/tests/ai/test_export.py @@ -7,11 +7,6 @@ from panel.chat import ChatMessage -from lumen.ai.assistant import Assistant -from lumen.ai.export import ( - LumenOutput, export_notebook, format_markdown, format_output, - make_preamble, -) from lumen.pipeline import Pipeline from lumen.sources.intake import IntakeSource from lumen.views import Table @@ -19,6 +14,15 @@ loop = asyncio.new_event_loop() asyncio.set_event_loop(loop) +try: + from lumen.ai.assistant import Assistant + from lumen.ai.export import ( + LumenOutput, export_notebook, format_markdown, format_output, + make_preamble, + ) +except ImportError: + pytest.skip("Skipping tests that require lumen.ai", allow_module_level=True) + @pytest.fixture def source():