Python Unit Testing – Using Mocks
Writing unit tests for programs that have external dependencies is tricky. One approach is mocking external dependencies. For example, if your program is writing to a MySQL database, you may not want to actually write to the database when you run unit tests. Instead, you can use a mock to simulate this operation. Python’s unittest.mock […]