Elektrine lite

← Feed

@adamchainz@fosstodon.org

Post #4266638

2026-07-25 22:03 UTC

✍️ New post on using unittest.mock to spy on function calls. 🕵️‍♂️ I recently learned how to use the wraps argument to track all calls to a target function for later assertions. Very useful for testing things like “is caching working?” without having to mock the function completely. #Python https://adamj.eu/tech/2026/07/25/python-spy-unittest-mock-wraps/

Replies (0)

No replies.