Skip to content

Commit bd24d98

Browse files
committed
Skip if numexpr is not installed
1 parent f1ed8df commit bd24d98

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

tests/conftest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,6 +1155,14 @@ def databricks_fixture(fail_missing: bool):
11551155
fail_missing=fail_missing)
11561156

11571157

1158+
@pytest.fixture(name="numexpr", scope='session')
1159+
def numexpr_fixture(fail_missing: bool):
1160+
"""
1161+
Fixture to ensure numexpr is installed
1162+
"""
1163+
yield import_or_skip("numexpr", reason=OPT_DEP_SKIP_REASON.format(package="numexpr"), fail_missing=fail_missing)
1164+
1165+
11581166
@pytest.mark.usefixtures("openai")
11591167
@pytest.fixture(name="mock_chat_completion")
11601168
def mock_chat_completion_fixture():

tests/morpheus_llm/llm/test_agents_simple_pipe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def test_agents_simple_pipe_integration_openai(config: Config, questions: list[s
127127
assert float(response_match.group(1)) >= 3.7
128128

129129

130-
@pytest.mark.usefixtures("langchain_community", "langchain_openai", "openai", "restore_environ")
130+
@pytest.mark.usefixtures("langchain_community", "langchain_openai", "numexpr", "openai", "restore_environ")
131131
@mock.patch("langchain_community.utilities.serpapi.SerpAPIWrapper.aresults")
132132
@mock.patch("langchain_openai.OpenAI._agenerate",
133133
autospec=True) # autospec is needed as langchain will inspect the function

0 commit comments

Comments
 (0)