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
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
text/gemini
This content has been proxied by September (3851b).