772
Senior devs... (suppo.fi)
you are viewing a single comment's thread
view the rest of the comments
[-] jjjalljs@ttrpg.network 1 points 4 months ago

It's not really that different from like


my_get_mock = Mock(side_effect=Some exception("oh no"))
result = some_func(http_getter=my_get_mock)

There's many ways of writing bad code and tests, but mocks and patches aren't always a bad tool. But sure, you can definitely fuck things up with them.

this post was submitted on 30 Jan 2026
772 points (97.1% liked)

Programmer Humor

31625 readers
1422 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 3 years ago
MODERATORS