title: FileNotFoundError when using python -m pytest vs. pytest
body: <p>I recently changed the IDE I am using to VSCode. For the most part I like it, but there is one particular problem that I can't seem to resolve. I didn't realize it was a problem either, until I moved IDEs.</p>
  
  <p>I have a directory structure like this:</p>
  
  <pre><code>my_app
  ├── env
  │   ├── bin
  │   ├── include
  │   ├── lib
  │   ├── lib64 -&gt; lib
  │   ├── pyvenv.cfg
  │   └── share
  ├── my_app
  │   ├── expected_results
  │   ├── __init__.py
  │   ├── test_data
  │   └── tests
  ├── pytest.ini
  ├── README.rst
  ├── setup.cfg
  └── setup.py
  </code></pre>
  
  <p>When I launch my virtual environment I am sitting at the root of this directory structure. </p>
  
  <p>I run my tests by issuing this command (or providing additional options). This currently works:</p>
  
  <pre><code>pytest
  </code></pre>
  
  <p>But, when VSCode launches, it spits out an error saying it can't find an expected file:</p>
  
  <pre><code>E   FileNotFoundError: [Errno 2] No such file or directory: 'my_app/expected_results/expected_available_items.yml'
  </code></pre>
  
  <p>After some investigation, I figured out that this is because when VSCode launches it issues the following command:</p>
  
  <pre><code>python -m pytest
  </code></pre>
  
  <p>I am setting that path by doing this:</p>
  
  <pre><code>import pathlib
  EXPECTED_RESULTS_BASE = pathlib.Path("my_app/expected_results")
  expected_results = EXPECTED_RESULTS_BASE.joinpath('expected_available_items.yml')
  </code></pre>
  
  <p>What do I need to modify so that my tests will continue to operate when I just issue a <code>pytest</code> command AND will operate if I (or my IDE, apparently) issues <code>python -m pytest</code>? </p>
  
  <p>I hope it's safe to assume that VSCode is launching this from the root of <code>my_app</code> like I am?</p>