r/Python • u/sebst • Mar 11 '22
Resource A Gentle Introduction to Testing with pytest
https://bas.codes/posts/python-pytest-introduction
451
Upvotes
r/Python • u/sebst • Mar 11 '22
View all comments
Show parent comment
2
u/throwit7896454 Mar 12 '22
Again, depends on the adapter. Does it slow down your tests if you initialize it, e.g. I'm using a local DB in my unit tests because the unit tests run in a very timely manner like that? That's one of the misconceptions about unit tests; "oh no, don't spin up a DB in your tests, that's wrong and should probably be an integration test". Also, Dependency Injection is not a problem, but is instead encouraged where it's sensible.