Talk Python To Me cover image

#407: pytest tips and tricks for better testing

Talk Python To Me

00:00

Pytest

Yield is a clever use of generators, right? It's very clever and also very nice because in you can have variables there that are needed for the cleanup. I would say avoid add Finalizer. Also, you can nest them. So leveraging using scopes. You can have like connect to a database by a session scope and then cleaning up the database as a function scope thing.

Transcript
Play full episode

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app