langchain-core
will define the interfaces we want to import to define our custom tool.langchain-tests
will provide the standard tests we want to use, as well as pytest
plugins necessary to run them. We recommend pinning to the latest version.langchain-tests
can break your CI/CD pipelines, we recommend pinning the
version of langchain-tests
to avoid unexpected changes.langchain-tests
package:
langchain_tests.unit_tests
): designed to be used to test the component in isolation and without access to external serviceslangchain_tests.integration_tests
): designed to be used to test the component with access to external services (in particular, the external service that the component is designed to interact with).pytest
class-based test suites.
By subclassing the base classes for each type of standard test (see below), you get all of the standard tests for that type, and you
can override the properties that the test suite uses to configure the tests.
In order to run the tests in the same way as this guide, we recommend subclassing these
classes in test files under two test subdirectories:
tests/unit_tests
for unit teststests/integration_tests
for integration testsChatModelUnitTests
and ChatModelIntegrationTests
. On each subclass, we override the following @property
methods to specify the chat model to be tested and the chat model’s configuration:Property | Description |
---|---|
chat_model_class | The class for the chat model to be tested |
chat_model_params | The parameters to pass to the chat |
model’s constructor |