# CustomSerializer

> **Class** in `langchain_tests`

📖 [View in docs](https://reference.langchain.com/python/langchain-tests/conftest/CustomSerializer)

Custom serializer for VCR cassettes using YAML and gzip.

We're using a custom serializer to avoid the default yaml serializer
used by VCR, which is not designed to be safe for untrusted input.

This step is an extra precaution necessary because the cassette files
are in compressed YAML format, which makes it more difficult to inspect
their contents during development or debugging.

## Signature

```python
CustomSerializer()
```

## Methods

- [`serialize()`](https://reference.langchain.com/python/langchain-tests/conftest/CustomSerializer/serialize)
- [`deserialize()`](https://reference.langchain.com/python/langchain-tests/conftest/CustomSerializer/deserialize)

---

[View source on GitHub](https://github.com/langchain-ai/langchain/blob/9f232caa7a8fe1ca042a401942d5d90d54ceb1a6/libs/standard-tests/langchain_tests/conftest.py#L20)