title: Chaining pytest fixtures
body: <p>I'm looking to be able to setup my tests to combine multiple fixtures into a single fixture - or inversely filter fixtures from another fixture. For example:</p>
  <pre class="lang-py prettyprint-override"><code>import pytest
  
  @pytest.fixture(params=[0,1,2,3,4,5,6])
  def number(request):
      return request.param
  
  @pytest.fixture()
  def odd_number(number):
      if number % 2 == 1:
          return number
      else:
          return None  # Skip (or some kid of filter)
  
  def test_all_positive(number):  # want to be called with 0, 1, 2, 3, 4, 5, and 6
      assert number &gt;= 0
  
  def test_all_odds_positive(odd_number):  # want to be called with 1, 3, and 5
      assert odd_number &gt;= 0
  </code></pre>
  <p>This is clearly not the the way <code>pytest</code> expects me to get the effect I want the <code>odd_number</code> fixture being passed into <code>test_all_odds_positive</code> to not include <code>None</code>s.</p>