Ancestors

Written by Alyssa Coghlan on 2024-09-03 at 11:57

I'm finally finding a way of working with pytest that I genuinely enjoy (I've bounced off it a few times in the past and went back to plain unittest on those projects). It isn't particularly complicated: use native pytest as the starting point when writing new test cases, but revert to unittest if pytest starts getting in the way instead of being helpful. The unittest integration is useful for more than just keeping previously existing tests running.

=> More informations about this toot | More toots from ancoghlan@mastodon.social

Toot

Written by Alyssa Coghlan on 2024-09-04 at 08:11

Also, keep fixtures local to the files that use them to limit how opaque the fixture usage magic gets (rather than defining complex fixtures that need to be shared via pytest's fixture loading magic, instead define regular old support classes and context managers, explicitly import them in the files that need them, and then wrap them in a local fixture to pass to the individual test cases).

=> More informations about this toot | More toots from ancoghlan@mastodon.social

Descendants

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113078270200109432
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
268.997105 milliseconds
Gemini-to-HTML Time
0.494388 milliseconds

This content has been proxied by September (3851b).