title: Can I add ini style configuration to pytest suites?
body: <p>I am using pytest to run tests in multiple environments and I wanted to include that information (ideally) in an ini style config file. I would also like to override parts or all of the configuration at the command line as well. I tried using the hook <code>pytest_addoption</code> in my <code>conftest.py</code> like so:</p>
  
  <pre><code>def pytest_addoption(parser):
      parser.addoption("--hostname", action="store", help="The host")
      parser.addoption("--port", action="store", help="The port")
  
  @pytest.fixture
  def hostname(request):
      return request.config.getoption("--hostname")
  
  @pytest.fixture
  def port(request):
      return request.config.getoption("--port")
  </code></pre>
  
  <p>Using this I can add the configuration info at the command line, but not in a config file. I also tried adding</p>
  
  <pre><code>[pytest]
  addopts = --hostname host --port 311
  </code></pre>
  
  <p>to my <code>pytest.ini</code> file, but that didn't work. Is there a way to do this without building my own plugin? Thanks for your time.</p>