Skip to content

Commit

Permalink
Skip if numexpr is not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
dagardner-nv committed Dec 17, 2024
1 parent f1ed8df commit bd24d98
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1155,6 +1155,14 @@ def databricks_fixture(fail_missing: bool):
fail_missing=fail_missing)


@pytest.fixture(name="numexpr", scope='session')
def numexpr_fixture(fail_missing: bool):
"""
Fixture to ensure numexpr is installed
"""
yield import_or_skip("numexpr", reason=OPT_DEP_SKIP_REASON.format(package="numexpr"), fail_missing=fail_missing)


@pytest.mark.usefixtures("openai")
@pytest.fixture(name="mock_chat_completion")
def mock_chat_completion_fixture():
Expand Down
2 changes: 1 addition & 1 deletion tests/morpheus_llm/llm/test_agents_simple_pipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def test_agents_simple_pipe_integration_openai(config: Config, questions: list[s
assert float(response_match.group(1)) >= 3.7


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

0 comments on commit bd24d98

Please sign in to comment.