title: How can I mock a method globally for all tests in python
body: <p>My Django project has hundreds of test in various modules across a number of apps. Recently we added a feature where an email gets sent (via sendgrid) on creation of a User object (using Django Signals).</p>
  
  <p>The problem we ran into is that when running tests, many users are created either explicitly or as fixtures. This results in many hundreds of emails being sent on each test cycle, and because most of them are invalid we get hundreds of bounces. In addition to the costs involved, Sendgrid actually suspended our account briefly due to the odd behaviour.</p>
  
  <p>Obviously I can mock the call on each test individually, however this would have to take place in hundreds of places, and we would have to remember to do it on all future tests we create.</p>
  
  <p>Is there an easier way to globally mock a particular chunk of code for all tests (leaving it intact for when actually running of course)</p>