3 ms·
Beautiful explanation for something that tripped me up in early days of using mock/patch. Summary: (1) Variables in Python are names that refer to values. (
by pramttl 7y ago
Beautiful explanation for something that tripped me up in early days of using mock/patch. Summary:
(1) Variables in Python are names that refer to values.
(2) (For that reason) Mock an object where it is used, not where it is defined.