Files
langchain/libs/standard-tests
dependabot[bot] 0076f37716 chore: bump vcrpy from 8.2.1 to 8.3.0 in /libs/standard-tests (#38827)
Bumps [vcrpy](https://github.com/kevin1024/vcrpy) from 8.2.1 to 8.3.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/kevin1024/vcrpy/releases">vcrpy's
releases</a>.</em></p>
<blockquote>
<h2>v8.3.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Add support for niquests (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/980">#980</a>)
— thanks <a
href="https://github.com/ionelmc"><code>@​ionelmc</code></a></li>
<li>Recording now fails fast if a request or response contains a Python
object the safe YAML loader (introduced in 8.2.1) couldn't read back,
instead of writing a cassette that breaks on replay. The error shows
exactly how to register the object if you need it (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/1007">#1007</a>,
<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/1009">#1009</a>)
— thanks <a
href="https://github.com/Polandia94"><code>@​Polandia94</code></a></li>
<li>New
<code>vcr.serializers.yamlserializer.with_custom_tags(...)</code> builds
a YAML serializer supporting custom Python object tags on both record
and replay, registered per VCR instance via
<code>register_serializer</code> (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/1007">#1007</a>,
<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/1009">#1009</a>)
— thanks <a
href="https://github.com/Polandia94"><code>@​Polandia94</code></a></li>
<li>Clearer error when a cassette contains an unsupported YAML tag, and
the stale git.io migration link is gone (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/1007">#1007</a>,
<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/1008">#1008</a>)
— thanks <a
href="https://github.com/gaoflow"><code>@​gaoflow</code></a></li>
<li>Fix stale keep-alive connection reuse across cassettes; unpin
werkzeug (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/1001">#1001</a>)</li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/kevin1024/vcrpy/compare/v8.2.1...v8.3.0">https://github.com/kevin1024/vcrpy/compare/v8.2.1...v8.3.0</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/kevin1024/vcrpy/blob/master/docs/changelog.rst">vcrpy's
changelog</a>.</em></p>
<blockquote>
<h2>Changelog</h2>
<p>All help in providing PRs to close out bug issues is appreciated.
Even if that is providing a repo that fully replicates issues. We have
very generous contributors that have added these to bug issues which
meant another contributor picked up the bug and closed it out.</p>
<ul>
<li>
<p>8.3.0</p>
<ul>
<li>Add support for niquests (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/980">#980</a>)
- thanks <a
href="https://github.com/ionelmc"><code>@​ionelmc</code></a></li>
<li>Refuse to record a cassette containing a Python object the safe YAML
loader could not read back, so recording fails fast instead of producing
a cassette that breaks on replay (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/1007">#1007</a>,
<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/1009">#1009</a>)
- thanks <a
href="https://github.com/Polandia94"><code>@​Polandia94</code></a></li>
<li>Add <code>vcr.serializers.yamlserializer.with_custom_tags</code> to
build a YAML serializer supporting custom Python object tags on both
record and replay, registered per VCR instance via
<code>register_serializer</code> (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/1007">#1007</a>,
<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/1009">#1009</a>)
- thanks <a
href="https://github.com/Polandia94"><code>@​Polandia94</code></a></li>
<li>Clearer error when a cassette contains an unsupported YAML tag, and
remove the stale git.io migration link (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/1007">#1007</a>,
<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/1008">#1008</a>)
- thanks <a
href="https://github.com/gaoflow"><code>@​gaoflow</code></a></li>
<li>Fix stale keep-alive connection reuse across cassettes; unpin
werkzeug (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/1001">#1001</a>)</li>
</ul>
</li>
<li>
<p>8.2.1</p>
<ul>
<li>SECURITY: Load cassettes with a safe YAML loader, preventing
arbitrary code execution when a cassette from an untrusted source is
loaded (GHSA-rpj2-4hq8-938g) - thanks <a
href="https://github.com/RamiAltai"><code>@​RamiAltai</code></a> and <a
href="https://github.com/EQSTLab"><code>@​EQSTLab</code></a></li>
<li>Validate <code>record_mode</code> and raise a clear error on an
invalid value (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/208">#208</a>)</li>
<li>Recommend pytest-recording over the unmaintained pytest-vcr in the
docs (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/986">#986</a>)</li>
</ul>
</li>
<li>
<p>8.2.0</p>
<ul>
<li>Add support for httpx 2.x (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/993">#993</a>)
- thanks <a
href="https://github.com/dsfaccini"><code>@​dsfaccini</code></a></li>
<li>Patch httpx transports instead of httpcore (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/972">#972</a>)
- thanks <a
href="https://github.com/seowalex"><code>@​seowalex</code></a></li>
<li>Fix aiohttp 3.14 compatibility: <code>AsyncStreamReaderMixin</code>
removed and <code>ClientResponse</code> now requires
<code>stream_writer</code> (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/995">#995</a>)
- thanks <a
href="https://github.com/dsfaccini"><code>@​dsfaccini</code></a></li>
<li>Account for modified requests when storing played cassettes, so
<code>drop_unused_requests</code> honours
<code>before_record_request</code> filtering (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/962">#962</a>)
- thanks <a
href="https://github.com/jamesbraza"><code>@​jamesbraza</code></a></li>
<li>Make the request URL available on <code>VCRHTTPResponse</code> (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/976">#976</a>)
- thanks <a
href="https://github.com/dAnjou"><code>@​dAnjou</code></a></li>
<li>Improve error message when a matching request has already been
consumed (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/985">#985</a>)
- thanks <a
href="https://github.com/Polandia94"><code>@​Polandia94</code></a></li>
<li>Fix body check in <code>convert_body_to_unicode</code> to use an
explicit type check (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/982">#982</a>)
- thanks <a
href="https://github.com/Polandia94"><code>@​Polandia94</code></a></li>
<li>Add env proxy cassette regression test (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/994">#994</a>)
- thanks <a
href="https://github.com/tine1117"><code>@​tine1117</code></a></li>
<li>Remove milestone references from docs (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/984">#984</a>)
- thanks <a
href="https://github.com/Polandia94"><code>@​Polandia94</code></a></li>
<li>CI: bump sphinx-rtd-theme from 3.0.2 to 3.1.0 (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/973">#973</a>)</li>
</ul>
</li>
<li>
<p>8.1.1</p>
<ul>
<li>Fix sync requests in async contexts for HTTPX (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/965">#965</a>)
- thanks <a
href="https://github.com/seowalex"><code>@​seowalex</code></a></li>
<li>CI: bump peter-evans/create-pull-request from 7 to 8 (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/969">#969</a>)</li>
</ul>
</li>
<li>
<p>8.1.0</p>
<ul>
<li>Enable brotli decompression if available (via <code>brotli</code>,
<code>brotlipy</code> or <code>brotlicffi</code>) (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/620">#620</a>)
- thanks <a
href="https://github.com/immerrr"><code>@​immerrr</code></a></li>
<li>Fix aiohttp allowing both <code>data</code> and <code>json</code>
arguments when one is None (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/624">#624</a>)
- thanks <a
href="https://github.com/leorochael"><code>@​leorochael</code></a></li>
<li>Fix usage of io-like interface with VCR.py (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/906">#906</a>)
- thanks <a href="https://github.com/tito"><code>@​tito</code></a> and
<a href="https://github.com/kevdevg"><code>@​kevdevg</code></a></li>
<li>Migrate to declarative Python package config (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/767">#767</a>)
- thanks <a
href="https://github.com/deronnax"><code>@​deronnax</code></a></li>
<li>Various linting fixes - thanks <a
href="https://github.com/jairhenrique"><code>@​jairhenrique</code></a></li>
<li>CI: bump actions/checkout from 5 to 6 (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/955">#955</a>)</li>
</ul>
</li>
<li>
<p>8.0.0</p>
<ul>
<li>BREAKING: Drop support for Python 3.9 (major version bump) - thanks
<a
href="https://github.com/jairhenrique"><code>@​jairhenrique</code></a></li>
<li>BREAKING: Drop support for urllib3 &lt; 2 - fixes CVE warnings from
urllib3 1.x (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/926">#926</a>,
<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/880">#880</a>)
- thanks <a
href="https://github.com/jairhenrique"><code>@​jairhenrique</code></a></li>
<li>New feature: <code>drop_unused_requests</code> option to remove
unused interactions from cassettes (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/763">#763</a>)
- thanks <a
href="https://github.com/danielnsilva"><code>@​danielnsilva</code></a></li>
<li>Rewrite httpx support to patch httpcore instead of httpx (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/943">#943</a>)
- thanks <a
href="https://github.com/seowalex"><code>@​seowalex</code></a>
<ul>
<li>Fixes <code>httpx.ResponseNotRead</code> exceptions (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/832">#832</a>,
<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/834">#834</a>)</li>
<li>Fixes <code>KeyError: 'follow_redirects'</code> (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/945">#945</a>)</li>
<li>Adds support for custom httpx transports</li>
</ul>
</li>
<li>Fix HTTPS proxy handling - proxy address no longer ends up in
cassette URIs (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/809">#809</a>,
<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/914">#914</a>)
- thanks <a href="https://github.com/alga"><code>@​alga</code></a></li>
</ul>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="c599974b31"><code>c599974</code></a>
Release v8.3.0</li>
<li><a
href="68cbe595ba"><code>68cbe59</code></a>
Show how to register a custom object in the cassette-not-saved
error</li>
<li><a
href="7a898b54c9"><code>7a898b5</code></a>
Refuse to record cassettes the safe YAML loader can't read back (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/1012">#1012</a>)</li>
<li><a
href="1421b36362"><code>1421b36</code></a>
fix: show descriptive error when cassette contains unsupported YAML tags
(<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/1008">#1008</a>)</li>
<li><a
href="b1fb62bf47"><code>b1fb62b</code></a>
Merge pull request <a
href="https://redirect.github.com/kevin1024/vcrpy/issues/1000">#1000</a>
from kevin1024/dependabot/pre_commit/https-/github.c...</li>
<li><a
href="9e741174c7"><code>9e74117</code></a>
Fix stale keep-alive connection reuse; unpin werkzeug (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/1001">#1001</a>)</li>
<li><a
href="30a721d400"><code>30a721d</code></a>
Loosen up some things to allow vcrpy to work with niquests (<a
href="https://redirect.github.com/kevin1024/vcrpy/issues/980">#980</a>)</li>
<li><a
href="393e349ad5"><code>393e349</code></a>
build(deps): bump <a
href="https://github.com/astral-sh/ruff-pre-commit">https://github.com/astral-sh/ruff-pre-commit</a></li>
<li>See full diff in <a
href="https://github.com/kevin1024/vcrpy/compare/v8.2.1...v8.3.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=vcrpy&package-manager=uv&previous-version=8.2.1&new-version=8.3.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/langchain-ai/langchain/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-14 00:40:04 -04:00
..

🦜🔗 langchain-tests

PyPI - Version PyPI - License PyPI - Downloads Twitter

Looking for the JS/TS version? Check out LangChain.js.

Quick Install

uv add langchain-tests

🤔 What is this?

This is a testing library for LangChain integrations. It contains the base classes for a standard set of tests.

📖 Documentation

For full documentation, see the API reference.

📕 Releases & Versioning

See our Releases and Versioning policies.

We encourage pinning your version to a specific version in order to avoid breaking your CI when we publish new tests. We recommend upgrading to the latest version periodically to make sure you have the latest tests.

Not pinning your version will ensure you always have the latest tests, but it may also break your CI if we introduce tests that your integration doesn't pass.

💁 Contributing

As an open-source project in a rapidly developing field, we are extremely open to contributions, whether it be in the form of a new feature, improved infrastructure, or better documentation.

For detailed information on how to contribute, see the Contributing Guide.

Usage

To add standard tests to an integration package (e.g., for a chat model), you need to create

  1. A unit test class that inherits from ChatModelUnitTests
  2. An integration test class that inherits from ChatModelIntegrationTests

tests/unit_tests/test_standard.py:

"""Standard LangChain interface tests"""

from typing import Type

import pytest
from langchain_core.language_models import BaseChatModel
from langchain_tests.unit_tests import ChatModelUnitTests

from langchain_parrot_chain import ChatParrotChain


class TestParrotChainStandard(ChatModelUnitTests):
    @pytest.fixture
    def chat_model_class(self) -> Type[BaseChatModel]:
        return ChatParrotChain

tests/integration_tests/test_standard.py:

"""Standard LangChain interface tests"""

from typing import Type

import pytest
from langchain_core.language_models import BaseChatModel
from langchain_tests.integration_tests import ChatModelIntegrationTests

from langchain_parrot_chain import ChatParrotChain


class TestParrotChainStandard(ChatModelIntegrationTests):
    @pytest.fixture
    def chat_model_class(self) -> Type[BaseChatModel]:
        return ChatParrotChain

Reference

The following fixtures are configurable in the test classes. Anything not marked as required is optional.

  • chat_model_class (required): The class of the chat model to be tested
  • chat_model_params: The keyword arguments to pass to the chat model constructor
  • chat_model_has_tool_calling: Whether the chat model can call tools. By default, this is set to hasattr(chat_model_class, 'bind_tools)
  • chat_model_has_structured_output: Whether the chat model can structured output. By default, this is set to hasattr(chat_model_class, 'with_structured_output')