用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/NVIDIA/NeMo-Fabric --skill python-tests命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | python-tests |
| description | Python tests for NeMo Fabric; use this when writing tests |
| author | NVIDIA Corporation and Affiliates |
| license | Apache-2.0 |
@pytest.mark.asyncio to any test. Async tests are automatically detected and run by the async runner; the decorator is unnecessary clutter.-> None return type annotation to test functions. This is not a common convention in pytest and adds unnecessary verbosity.unittest.mock.MagicMock or unittest.mock.AsyncMock, with the spec constructor argument when necessary.mock, not fake.conftest.py file.@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".pytest.mark.parametrize over creating individual tests for
different input types.@pytest.mark.usefixtures decorator.tests/conftest.py contains a restore_environ_fixture fixture that restores the environment variables to their original state after each test, it is defined with autouse=True so it is automatically applied to all tests. If you need to modify the environment variables in a test, do so using os.environ and the fixture will restore them after the test completes. There is no need to use monkeypatch.setenv to modify environment variables in tests.data = results["data"]
is preferred over
data = results.get("data")
Simply allow the resulting KeyError to be raised if the "data" key is not present in the results dictionary, as this will provide a clear indication of what went wrong in the test.# Focused test loop
uv run pytest -k "<pattern>"
# Run all tests
uv run pytest
tests/_utils/.pyproject.tomltests/conftest.py