Skip to content

Instantly share code, notes, and snippets.

@judy2k
judy2k / monkey-patch.py
Created March 16, 2017 09:55
Monkey Patching Functions
# So, a bit like mocking/patching, it depends on how the thing you're patching is imported *where it's used*.
# If the code that uses it is in a module called `client`, you'd want to do one of the following:
# If client.py looks like this:
from django.things import victim
def useful_function():
victim(blah)