title: Pass a parameter to a fixture function
body: <p>I am using py.test to test some DLL code wrapped in a python class MyTester.
  For validating purpose I need to log some test data during the tests and do more processing afterwards. As I have many test_... files I want to reuse the tester object creation (instance of MyTester) for most of my tests.</p>
  <p>As the tester object is the one which got the references to the DLL's variables and functions I need to pass a list of the DLL's variables to the tester object for each of the test files (variables to be logged are the same for a test_... file).
  The content of the list is used to log the specified data.</p>
  <p>My idea is to do it somehow like this:</p>
  <pre><code>import pytest
  
  class MyTester():
      def __init__(self, arg = [&quot;var0&quot;, &quot;var1&quot;]):
          self.arg = arg
          # self.use_arg_to_init_logging_part()
  
      def dothis(self):
          print &quot;this&quot;
  
      def dothat(self):
          print &quot;that&quot;
  
  # located in conftest.py (because other test will reuse it)
  
  @pytest.fixture()
  def tester(request):
      &quot;&quot;&quot; create tester object &quot;&quot;&quot;
      # how to use the list below for arg?
      _tester = MyTester()
      return _tester
  
  # located in test_...py
  
  # @pytest.mark.usefixtures(&quot;tester&quot;) 
  class TestIt():
  
      # def __init__(self):
      #     self.args_for_tester = [&quot;var1&quot;, &quot;var2&quot;]
      #     # how to pass this list to the tester fixture?
  
      def test_tc1(self, tester):
         tester.dothis()
         assert 0 # for demo purpose
  
      def test_tc2(self, tester):
         tester.dothat()
         assert 0 # for demo purpose
  </code></pre>
  <p>Is it possible to achieve it like this or is there even a more elegant way?</p>
  <p>Usually I could do it for each test method with some kind of setup function (xUnit-style). But I want to gain some kind of reuse. Does anyone know if this is possible with fixtures at all?</p>
  <p>I know I can do something like this: (from the docs)</p>
  <pre><code>@pytest.fixture(scope=&quot;module&quot;, params=[&quot;merlinux.eu&quot;, &quot;mail.python.org&quot;])
  </code></pre>
  <p>But I need to the parametrization directly in the test module.
  <strong>Is it possible to access the params attribute of the fixture from the test module?</strong></p>