OverviewHistoryStatsSecurity
npx skills add ...
Documentation
SKILL.md
npx skills add nvidia/nemo-fabric --skill python-tests
Python tests for NeMo Fabric; use this when writing tests
npx skills add nvidia/nemo-fabric --skill python-tests
@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.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.tests/_utils/.pyproject.tomltests/conftest.py