title: How and where does py.test find fixtures
body: <p>Where and how  does  py.test  look for  fixtures? I  have  the  same code  in 2 files in the  same  folder. When I  delete conftest.py, cmdopt  cannot  be  found running test_conf.py (also in same  folder.  Why  is  sonoftest.py not  searched?</p>
  
  <pre><code># content of test_sample.py
  def test_answer(cmdopt):
      if cmdopt == "type1":
          print ("first")
      elif cmdopt == "type2":
          print ("second")
      assert 0 # to see what was printed
  </code></pre>
  
  <h1>content of conftest.py</h1>
  
  <pre><code>import pytest
  
  def pytest_addoption(parser):
      parser.addoption("--cmdopt", action="store", default="type1",
          help="my option: type1 or type2")
  
  @pytest.fixture
  def cmdopt(request):
      return request.config.getoption("--cmdopt")
  </code></pre>
  
  <h1>content of sonoftest.py</h1>
  
  <pre><code>import pytest
  
  def pytest_addoption(parser):
      parser.addoption("--cmdopt", action="store", default="type1",
          help="my option: type1 or type2")
  
  @pytest.fixture
  def cmdopt(request):
      return request.config.getoption("--cmdopt")
  </code></pre>
  
  <p>The  docs say</p>
  
  <p><a href="http://pytest.org/latest/fixture.html#fixture-function">http://pytest.org/latest/fixture.html#fixture-function</a></p>
  
  <blockquote>
    <ol>
    <li>pytest finds  the test_ehlo  because of the test_ prefix. The test function needs a function argument named smtp. A matching fixture
    function is discovered by looking for a fixture-marked function named
    smtp.</li>
    <li>smtp() is called to create an instance.</li>
    <li>test_ehlo() is called and fails in the last line of the test function.</li>
    </ol>
  </blockquote>