I'm writing a lot of Go & Python these days, and both affect the way I write code.
One feature I really like in Go is defer. Lately, after writing some complicated pytest fixtures, I tried to make simpler and use a "defer" like fixture. Here's what I came with:
Out of the context of pytest, the same idea can become a context manager: