Skip to content

Commit 24b3574

Browse files
committed
Add agent rules that avoid adding @pytest.mark.asyncio in tests
Signed-off-by: Yuchen Zhang <[email protected]>
1 parent e460001 commit 24b3574

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

.coderabbit.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ reviews:
129129
digit version (ex: `~=1.0`).
130130
- Not all packages contain Python code, if they do they should also contain their own set of tests, in a
131131
`tests/` directory at the same level as the `pyproject.toml` file.
132-
- When adding a new package, that new package name (as defined in the `pyproject.toml` file) should
132+
- When adding a new package, that new package name (as defined in the `pyproject.toml` file) should
133133
be added as a dependency to the nvidia-nat-all package in `packages/nvidia_nat_all/pyproject.toml`
134134
135135
- path: "tests/**/*.py"
@@ -142,6 +142,8 @@ reviews:
142142
@pytest.fixture(name="my_fixture")
143143
def fixture_my_fixture():
144144
pass
145+
- Do NOT add `@pytest.mark.asyncio` to any test. Async tests are automatically detected and run by the
146+
async runner - the decorator is unnecessary clutter.
145147
146148
auto_apply_labels: true
147149
suggested_labels: true

.cursor/rules/nat-tests/general.mdc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ All tests in NeMo Agent toolkit use pytest. See the general coding guidelines fo
2626
- Use `@pytest.fixture(name="fixture_name")` decorator pattern
2727
- Mock external services with `pytest_httpserver` or `unittest.mock`
2828
- Maintain ≥ 80% code coverage
29+
- Do NOT add `@pytest.mark.asyncio` to any test - async tests are automatically detected and run by the async runner
2930

3031
### Integration Tests
3132

.cursor/rules/nat-tests/integration-tests.mdc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ Key practices:
175175
- Import third-party service libraries at module level in fixtures
176176
- Use function scope for service fixtures (use session scope)
177177
- Fail tests when services are unavailable (skip them instead)
178+
- Add `@pytest.mark.asyncio` decorator - async tests are automatically detected and run by the async runner
178179

179180
## Running Integration Tests
180181

0 commit comments

Comments
 (0)