title: PyTest not discovering new test module, but changes made in old test modules are reflected in execution
body: <p><strong>(This has been fixed, please read the edit at the bottom even if nobody submits an answer)</strong></p>
  
  <p>I am writing tests for an app using PyTest, and had three test modules as of this evening. They work as expected, and any changes I make to them are reflected in the test execution (I intentionally put incorrect assertions to be completely sure). However, I added a new module this evening (which also begins with test_ and does not contain a class (so <a href="https://stackoverflow.com/questions/49642618/pytest-not-discovering-test-in-pydev">this SO answer</a> does not apply), it is in fact almost identical in structure to one other test module) and no matter what I do PyTest refuses to discover it. I am using VS Code for development, but I tried running pytest from the terminal as well, to the same effect. </p>
  
  <p><a href="https://github.com/DonJayamanne/pythonVSCode/issues/307" rel="nofollow noreferrer">This issue on GitHub</a> suggested I try <code>rm -rf .cache</code> which solved nothing. I tried removing all my <code>__pycache__</code> files just to be safe as well as the <code>.pytest_cache</code> file, to no avail. I checked the contents of the <code>.pytest_cache</code> file after removing and running <code>pytest</code> again, and none of the new tests are shown in the <code>nodeids</code>. I do not get any errors, in particular <code>test_grader.py</code>, <code>test_misc.py</code> and <code>test_solution_optimal.py</code> work perfectly fine. Here is <a href="https://www.dropbox.com/s/k6we7ydf3o5d8t4/Screenshot%202019-01-01%2021.52.16.jpg?dl=0" rel="nofollow noreferrer">proof</a> haha. <code>test_solution_student.py</code> is an exact copy of <code>test_solution_optimal.py</code> with a few deliberately incorrect assertions, but pytest won't discover it no matter what I do. Additionally, the <code>__pycache__</code> in the <code>tests</code> directory contains a .pyc file corresponding to <code>test_solution_student.py</code>, which is just plain strange to me. I even tried renaming the file to something different thinking the discovery might be ignoring the second test because they both start with <code>test_solution_</code>, but nope.</p>
  
  <p>I only enabled pytest as recommended <a href="https://code.visualstudio.com/docs/python/unit-testing" rel="nofollow noreferrer">here</a> and the autoTestDiscover.... is enabled as well. However since running pytest from the terminal does not result in the discovery of the last module either I doubt it's an issue with my VS code settings file. </p>
  
  <p>Directory structure:</p>
  
  <pre><code>Top-Level Directory
  ├── .pytest_cache
  │   └── v
  ├── Grader
  │   ├── (Several files to be tested)
  │   ├── __init__.py
  │   └── __pycache__
  ├── __pycache__
  │   └── globals_store.cpython-37.pyc
  ├── graphs
  │   ├── (Additional irrelevant files)
  ├── tests
  │   ├── __pycache__
  │   ├── test_grader.py
  │   ├── test_misc.py
  │   ├── test_solution_optimal.py
  │   └── test_solution_student.py
  └── venv
      ├── bin
      ├── include
      ├── lib
      └── share
  </code></pre>
  
  <p>I run <code>pytest</code> from the Top-Level Directory.</p>
  
  <p>If somebody could give me a lead on what else I could try that might result in the test module being discovered I would forever be in your debt. I am not supposed to share the project since this is part of a homework assignment I am creating, but I am working on reproducing this issue in a dummy project.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>I "fixed" it; the issue lay with me duplicating the <code>test_solution_optimal</code> file, (duplicating code did smell funny to me, should have known to trust my intuition but I couldn't use that code out of the box and needed to make subtle modifications) which resulted in me redefining a fixture which I have now moved to a <code>conftest.py</code> file (I'm new to pytest, please forgive). I now know not to duplicate code (like, ever) but I am still curious as to why this was causing an issue which is why I chose not to add this as an answer to my question. If somebody could chime in with an explanation, be my guest :D</p>