title: Cython & Python Project Test Driven Development and .pyx file structure advice
body: <p>What is the best way to structure a <code>python/cython</code> project such that I can unit test code that resides in <code>.pyx</code> files? Is it possible to unit test this code in place or will refactoring allow me to achieve this in another way?</p>
  
  <p>I am new to <code>cython</code> but have experience with Python TDD, mocking etc. I am also aware that the decision to cythonise some of the python code base <em>could</em> have been a premature optimisation decision. I have just joined a new team and therefore I am working on an existing code base. I am trying to get a feel for best practices.</p>
  
  <p>Also in PyCharm, modules written in .pyx files are show as unresolved references in the editor - I have just read about <code>pyximport</code> but I am not sure if PyCharm is set up correctly for <code>cython</code> (I have the latest professional edition).</p>
  
  <p>I am aware of the <a href="http://docs.cython.org/src/userguide/" rel="nofollow noreferrer">cython user guide</a> but I cannot find advice on testing. I am also aware of <a href="http://www.jetbrains.com/pycharm/help/cython-support.html" rel="nofollow noreferrer">pycharm's setup guide</a> but this suggests that cython support is out of the box, which seems to contradict what I experience.</p>