title: Pycharm module import fails when running tests, but not when running main script
body: <p>I have a pycharm project with the following structure</p>
  <pre><code>root
  |_test.py
  |_code
       |_a.py
       |_b.py
  </code></pre>
  <p>When I run a.py, it imports a function from b.py and it runs correctly.</p>
  <p>However, when I run test.py (which imports functions from a and therefore from b, I get the following error message: ModuleNotFoundError: No module named b.py</p>
  <p>Does anybody know why this might happen?</p>