Skip to content

Commit 3db1aa0

Browse files
ccurmeeyurtsev
andauthored
standard-tests: migrate to pytest-recording (#31425)
Co-authored-by: Eugene Yurtsev <[email protected]>
1 parent d7f90f2 commit 3db1aa0

15 files changed

+180
-114
lines changed

libs/partners/anthropic/tests/cassettes/TestAnthropicStandard_test_stream_time.yaml.gz

Lines changed: 0 additions & 1 deletion
This file was deleted.

libs/partners/anthropic/tests/conftest.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from typing import Any
22

33
import pytest
4-
from langchain_tests.conftest import YamlGzipSerializer
4+
from langchain_tests.conftest import CustomPersister, CustomSerializer
55
from langchain_tests.conftest import _base_vcr_config as _base_vcr_config
66
from vcr import VCR # type: ignore[import-untyped]
77

@@ -32,9 +32,6 @@ def vcr_config(_base_vcr_config: dict) -> dict: # noqa: F811
3232
return config
3333

3434

35-
@pytest.fixture
36-
def vcr(vcr_config: dict) -> VCR:
37-
"""Override the default vcr fixture to include custom serializers"""
38-
my_vcr = VCR(**vcr_config)
39-
my_vcr.register_serializer("yaml.gz", YamlGzipSerializer)
40-
return my_vcr
35+
def pytest_recording_configure(config: dict, vcr: VCR) -> None:
36+
vcr.register_persister(CustomPersister())
37+
vcr.register_serializer("yaml.gz", CustomSerializer())

libs/partners/anthropic/uv.lock

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.

libs/partners/openai/tests/cassettes/TestOpenAIResponses_test_stream_time.yaml.gz

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)