How to use Python's unittest.mock.patch

Published: 01 December 2019
on channel: redshiftzero
101,041
1.8k

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/uni...
Where to patch: https://docs.python.org/3/library/uni...


Watch video How to use Python's unittest.mock.patch online without registration, duration hours minute second in high quality. This video was added by user redshiftzero 01 December 2019, don't forget to share it with your friends and acquaintances, it has been viewed on our site 101,041 once and liked it 1.8 thousand people.