title: Pytest import problems when tests import from adjacent directory
body: <pre><code>/root
  |- __init__.py
  |
  |- /src 
  |  |
  |  |- __init__.py
  |  |- /x
  |     |
  |     |- __init__.py
  |     |- xy.py
  |
  |- /tests
  |  |- __init__.py
  |  |- /test_x
  |     |
  |     |- __init__.py
  |     |- test_xy.py
  </code></pre>
  <pre><code># tests/test_x/test_xy.py 
  
  from src.x.xy import XY
  
  Class TestXY:
  
      # etc 
  
  </code></pre>
  <p>When I’m in root I try to run <code>pytest tests/*/*</code> and I get an error that due to <code>from src.x.xy import XY</code> because <code>src</code> can’t be found. If I change the import to <code>from …src.x.xy import XY</code> I get “cannot import” because it’s from a directory one level above.</p>
  <p>I also tried running <code>Python -m pytest tests/*/*</code> but I get an error about conftest not being found in <code>__pycache__</code> which I don’t understand. <code>(ERROR: not found: /root/tests/__pycache__/conftest.cpython-310-pytest-7.1.2.pyc (no name '/root/tests/__pycache__/conftest.cpython-310-pytest-7.1.2.pyc' in any of []))</code></p>
  <p>What am I missing? Why is it so hard to run tests this way? I can run them individually in pycharm by clicking the little green arrows in the test script no problem.</p>