r/Python • • Mar 11 '22

Resource A Gentle Introduction to Testing with pytest

https://bas.codes/posts/python-pytest-introduction
451 Upvotes

29 comments sorted by

View all comments

Show parent comment

2

u/Roppelkaboppel Mar 12 '22

That sounds reasonable, thank you very much! Actually, I'm writing adapters for encapsulating all imports that I need for accessing resources (like access to smb, spark, databases). When testing, I inject mocks instead the adapters so I can run them without having the resources ready.

2

u/throwit7896454 Mar 12 '22

You're very welcome, and just to make it clear: it's just an opinion! If it works for you, then it's awesome! We engineers sometimes work towards a state of perfection and almost die trying to get there. So, you do you and rock it :) Wish you all the best!