Advanced Pytest: Mock
· ☕ 3 min read
1. Why We Need Mock When writing unit tests, the function under test is sometimes not a self-contained executable unit. It depends on external resources, such as the return value of another function or a value in a row of a database. To shield the test from interference from external