Skip to content

Latest commit

 

History

History
16 lines (12 loc) · 589 Bytes

File metadata and controls

16 lines (12 loc) · 589 Bytes

Mock

What is it

Python library for tests

It provides usefull objects (Mock / MagicMock) with which you can :

  • Patch a method or an object attribute
  • Check if a patch method is called / not called / called with value(s)
  • Make a patched method returning specific data
  • Make a patched method calling another method when the patched one is called
  • Patch libraries to control it's objects in order to only test your code

This is usefull for unit tests. Owever be carefull not to overuse it !

Links