title: Passing a command line argument to a py.test fixture as a parameter
body: <p>Admittedly it is not the best way to do it to start with and more importantly the fixture parameters are resolved i.e. Options.get_option() is called before everything else. 
  Recommendations and suggestions would be appreciated.</p>
  
  <p>From config.py</p>
  
  <pre><code>class Options(object):
      option = None
  
      @classmethod
      def get_option(cls):
          return cls.option
  </code></pre>
  
  <p>From conftest.py</p>
  
  <pre><code>@pytest.yield_fixture(scope='session', autouse=True)
  def session_setup():
      Options.option = pytest.config.getoption('--remote')
  
  def pytest_addoption(parser):
      parser.addoption("--remote", action="store_true", default=False, help="Runs tests on a remote service.")
  
  
  
  
  @pytest.yield_fixture(scope='function', params=Options.get_option())
  def setup(request):
      if request.param is None:
          raise Exception("option is none")
  </code></pre>