mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-02 11:39:18 +00:00
standard-tests[patch]: Add pytest assert rewrites (#24408)
This will surface nice error messages in subclasses that fail assertions.
This commit is contained in:
@@ -1,3 +1,21 @@
|
||||
# ruff: noqa: E402
|
||||
import pytest
|
||||
|
||||
# Rewrite assert statements for test suite so that implementations can
|
||||
# see the full error message from failed asserts.
|
||||
# https://docs.pytest.org/en/7.1.x/how-to/writing_plugins.html#assertion-rewriting
|
||||
modules = [
|
||||
"base_store",
|
||||
"cache",
|
||||
"chat_models",
|
||||
"vectorstores",
|
||||
]
|
||||
|
||||
for module in modules:
|
||||
pytest.register_assert_rewrite(
|
||||
f"langchain_standard_tests.integration_tests.{module}"
|
||||
)
|
||||
|
||||
from langchain_standard_tests.integration_tests.chat_models import (
|
||||
ChatModelIntegrationTests,
|
||||
)
|
||||
|
@@ -1,4 +1,5 @@
|
||||
"""Test suite to test vectostores."""
|
||||
|
||||
import inspect
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
|
@@ -1,3 +1,16 @@
|
||||
# ruff: noqa: E402
|
||||
import pytest
|
||||
|
||||
# Rewrite assert statements for test suite so that implementations can
|
||||
# see the full error message from failed asserts.
|
||||
# https://docs.pytest.org/en/7.1.x/how-to/writing_plugins.html#assertion-rewriting
|
||||
modules = [
|
||||
"chat_models",
|
||||
]
|
||||
|
||||
for module in modules:
|
||||
pytest.register_assert_rewrite(f"langchain_standard_tests.unit_tests.{module}")
|
||||
|
||||
from langchain_standard_tests.unit_tests.chat_models import ChatModelUnitTests
|
||||
|
||||
__all__ = ["ChatModelUnitTests"]
|
||||
|
@@ -1,4 +1,5 @@
|
||||
"""Tests for the InMemoryStore class."""
|
||||
|
||||
from typing import Tuple
|
||||
|
||||
import pytest
|
||||
|
Reference in New Issue
Block a user