Search the courses, subjects, tracks, games and features, or jump straight to a page.
4 cards from this section. Quick, good the night before a test.
What is the purpose of patching in unit tests?
Think about isolation.
What does the unittest.mock module provide?
What module is built into Python for testing?
What does the patch decorator do?
What is its main function in unit testing?
True or False: Patching can help tests run faster by avoiding external calls.
Think about the impact of external calls on test speed.
Create a unit test that uses mocking to check how your application handles a failure in retrieving user data from a remote database.
What would cause your application to fail in this context?
Write a comprehensive testing strategy that outlines the use of patching throughout your application cycle.
Consider the various points in development where testing occurs.
6 more questions in this section. Enroll free to practise them all.
Enroll free