Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .agents/skills/test-python-binding/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ Use this skill when the change is primarily in `python/nemo_flow`,
- The name of the mocked class should be prefixed with `mock`, not `fake`.
- Prefer pytest fixtures over helper methods.
- Do not repeat fixtures, if a fixture is needed in multiple test files, place it in a `conftest.py` file.
- When creating a fixture follow this pattern:
```python
@pytest.fixture(name="<fixture_name>"[, scope="<scope>"])
def <fixture_name>_fixture() -> <return_type>:
...
```
Only specify the scope argument when the value is something other than "function".
- Prefer `pytest.mark.parametrize` over creating individual tests for
different input types.

Expand Down
1 change: 1 addition & 0 deletions python/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import typing
from collections.abc import Iterator
import types
from uuid import uuid4

import pytest
Expand Down
42 changes: 42 additions & 0 deletions python/tests/integrations/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

import types

import pytest


@pytest.fixture(name="integration_langchain", scope='session')
def integration_langchain_fixture() -> types.ModuleType:
"""
Use for integration tests that require LangChain to be installed.
"""
try:
import langchain
return langchain
except Exception:
pytest.skip(reason="langchain must be installed to run LangChain based tests")


@pytest.fixture(name="integration_langgraph", scope='session')
def integration_langgraph_fixture(integration_langchain: types.ModuleType) -> types.ModuleType:
"""
Use for integration tests that require LangGraph to be installed.
"""
try:
import langgraph
return langgraph
except Exception:
pytest.skip(reason="langgraph must be installed to run LangGraph based tests")


@pytest.fixture(name="integration_deepagents", scope='session')
def integration_deepagents_fixture(integration_langgraph: types.ModuleType) -> types.ModuleType:
"""
Use for integration tests that require Deep Agents to be installed.
"""
try:
import deepagents
return deepagents
except Exception:
pytest.skip(reason="deepagents must be installed to run Deep Agents based tests")
13 changes: 13 additions & 0 deletions python/tests/integrations/deepagents/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

import types

import pytest

@pytest.fixture(name="integration_deepagents", scope='session', autouse=True)
def integration_deepagents_fixture(integration_deepagents: types.ModuleType) -> types.ModuleType:
"""
Override the integration_deepagents fixture to make it autouse
"""
yield integration_deepagents
291 changes: 0 additions & 291 deletions python/tests/integrations/langchain/test_middleware.py

This file was deleted.

13 changes: 13 additions & 0 deletions python/tests/integrations/langchain_tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

import types

import pytest

@pytest.fixture(name="integration_langchain", scope='session', autouse=True)
def integration_langchain_fixture(integration_langchain: types.ModuleType) -> types.ModuleType:
"""
Override the integration_langchain fixture to make it autouse
"""
yield integration_langchain
Loading