title: Testing only affected code in Python
body: <p>I've been working on a fairly large Python project with a number of tests. </p>
  
  <p>Some specific parts of the application require some CPU-intensive testing, and our approach of testing everything before commit stopped making sense. </p>
  
  <p>We've adopted a tag-based selective testing approach since. The problem is that, as the codebase grows, maintaining said tagging scheme becomes somewhat cumbersome, and I'd like to start studying whether we could build something smarter.</p>
  
  <p>In a previous job the test system was such that it only tested code that was affected by the changes in the commit. </p>
  
  <p>It seems like <a href="http://continuoustests.com/" rel="noreferrer">Mighty Moose</a> employs a similar approach for <code>CLR</code> languages. Using these as inspiration, my question is, what alternatives are there (if any) for smart selective testing in <code>Python</code> projects?</p>
  
  <p>In case there aren't any, what would be good initial approaches for building something like that?</p>