Lines Matching full:patching
29 Mock Patching Methods
34 * Patching methods
375 for example patching a builtin or patching a class in a module to test that it
376 is instantiated. Modules and classes are effectively global, so patching on
382 ``package.module.Class.attribute`` to specify the attribute you are patching. It
405 If you are patching a module (including :mod:`builtins`) then use :func:`patch`
615 <https://williambert.online/2011/07/how-to-unit-testing-in-django-with-mocking-and-patching/>`_.
686 These allow you to move the patching into your ``setUp`` and ``tearDown`` methods.
702 If you use this technique you must ensure that the patching is "undone" by
722 Whilst writing tests today I needed to patch an *unbound method* (patching the
733 If you pass ``autospec=True`` to patch then it does the patching with a