title: Parametrize pytest fixture
body: <p>As far as I understood from the documentation about pytest fixture parameterization - it creates copies of the fixture with the given params and thus calls each test which requires this fixture with this different copies.</p>
  
  <p>My needs are a little bit different. Suppose there is a fixture:</p>
  
  <pre><code>@pytest.fixture
  def sample_foo():
      return Foo(file_path='file/path/test.json')
  
  def test1(sample_foo):
      pass
  
  def test2(sample_foo):
      pass
  </code></pre>
  
  <p>The problem is that test <code>test1</code> and <code>test2</code> require the same instance of class <code>Foo</code> but with different values of <code>file_path</code> </p>
  
  <p>So at the moment I do:</p>
  
  <pre><code>def build_foo(path):
     return Foo(file_path=path)
  
   def test1():
       sample_foo = build_foo('file/path/some.json')
  
   def test2():
       sample_foo = build_foo('file/path/another.json')
  </code></pre>
  
  <p>This looks like a little bit of code duplication. I could create a separate fixtures for each file but that looks even worse. It looks that each test will require it's own unique file, so maybe this can be solved by figuring out the name of the file by looking at the name of the test function requesting the fixture. But that is not guaranteed.</p>