title: pytest parametrize using values from a fixture
body: <p>I have a fixture (lets call it <code>class_fixture</code>) that dynamically returns a class I wish to run tests on.</p>
  <p>I have another fixture (lets call it <code>methods_fixture</code>) that uses <code>class_fixture</code> and returns the names of all methods (that fit a specific criteria) of that class.</p>
  <p>I also have a test that uses both fixtures and performs certain checks all methods:</p>
  <pre><code>def test_methods(class_fixture, methods_fixture):
      for method in methods_fixture:
          # DO TESTS ON class_fixture.method, for our example, lets test method name starts with DUMMY
          assert getattr(class_fixture, method).__name__.startswith(&quot;DUMMY&quot;)
  </code></pre>
  <p>I would like to convert that test to be parameterized and be similar to the following:</p>
  <pre><code>def test(class_fixture, methods_fixture_as_parameter):
      # This test function should generate multiple tests, one for each method returned by `methods_fixture`
      # DO TESTS ON class_fixture.method, for our example, lets test method name starts with DUMMY
      assert getattr(class_fixture, methods_fixture_as_parameter).__name__.startswith(&quot;DUMMY&quot;)
  </code></pre>
  <p>I tried going over pytest's parametrize documentation and couldn't find anything that fits. Since <code>methods_fixture</code> depends on a different fixture, I can't seem to implement what I want (because I assume I don't have the list of methods at test-creation time).</p>
  <p>I couldn't get it to work with <code>indirect</code>, although it might be possible.</p>
  <p>I also tried adding a <code>pytest_generate_tests</code> hook, but couldn't reach the values of <code>methods_fixture</code> or <code>class_fixture</code> to actually set the parameter values.</p>