inline-snapshot: How We Write Tests at Pydantic
Blog post from Pydantic
Pydantic has adopted the use of the inline-snapshot library to enhance the efficiency and maintainability of their testing processes, particularly for complex data structures. This approach allows for automatic updates of test snapshots when data structures change, significantly reducing manual labor and improving test coverage. By integrating inline-snapshot with dirty-equals, they can handle dynamic data fields more effectively, ensuring comprehensive assertions without cumbersome manual updates. This methodology was successfully applied to the OpenAI Agents SDK, streamlining the testing process and improving developer productivity. Additionally, Pydantic emphasizes the importance of supporting open-source projects, as demonstrated by their sponsorship of Frank, the creator of inline-snapshot, and their active participation in the open-source community.