nemoguardrails.testing.fixtures
Pytest fixtures exposing the public testing surface.
To opt in, add the following to your project’s conftest.py:
The fixtures below provide reasonable defaults that cover the most common
testing patterns: a scriptable FakeLLMModel and a TestChat
factory that wires the fake model into an LLMRails app.
Module Contents
Functions
API
Return a FakeLLMModel with a single "Hello!" response.
Override the responses by overriding this fixture in your own conftest, or
instantiate FakeLLMModel directly when you need custom behaviour:
Return a factory for building FakeLLMModel instances.
Useful when a single test needs more than one fake model, or when the set of responses is computed dynamically:
Return a factory that builds TestChat instances bound to a
fake LLM.
Example: