Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
What is the purpose of mocking in unit testing?
Think about what dependencies might slow down your tests.
Name one class provided in the unittest.mock module.
Remember, these classes help create mock objects.
What is mocking?
Think about both the benefits of speed and isolation.
The unittest.mock module is primarily used for?
Think about what you typically use this module for.
Create a function that retrieves user data from an API, and write a test for this function that uses mocking to simulate the API response.
Use exemplars from class, focusing on how to test without calling the actual API.
Explain what would happen if you forget to mock an external dependency in your tests and the tests run on a CI/CD pipeline.
Think about the impact of external variability in testing.
5 more questions in this section. Enroll free to practise them all.
Enroll free