Back to Browse

How to use Python's unittest.mock.patch

110.6K views
Dec 1, 2019
8:12

How to use (and where to apply) Python's unittest.mock.patch in your test suites. In this video I show where to patch, and three ways of applying mock.patch: as a decorator, as a context manager, and inline using mock.patch.start() and mock.patch.stop(). Further reading: Python docs on unittest.mock.patch: https://docs.python.org/3/library/unittest.mock.html#patch Where to patch: https://docs.python.org/3/library/unittest.mock.html#where-to-patch

Download

0 formats

No download links available.

How to use Python's unittest.mock.patch | NatokHD