title: Pytest, change counter that is passed to markers dynamically
body: <p>I am reading my test data from a Python file as follows.</p>
  <p>//testdata.py -- its a list of sets.</p>
  <pre><code>TEST_DATA = [
  (
  {&quot;test_scenario&quot;:&quot;1&quot;}, {&quot;test_case_id&quot;:1}
  ),
  (
  {&quot;test_scenario&quot;:&quot;2&quot;}, {&quot;test_case_id&quot;:2}
  )
  ]
  </code></pre>
  <p>Now I use this test data as part of a pytest test file.</p>
  <pre><code>// test.py
  // import testdata
  
  test_data = testdata.TEST_DATA   
  start = 0
  
  class TestOne():
      
       @pytest.mark.parametrize((&quot;test_scenario,testcase_id&quot;),test_data)
       @testcaseid.marktc[test_data[start][1][&quot;test_case_id&quot;]]
       def testfunction():
           global start
           start = start + 1
           // Doing test here. 
  </code></pre>
  <p>Now when I print start, it changes its value continuoulsy. But when I try to retrieve the pytest results, I still keep getting start = 0 due to which my test case ID isnt being recorded properly.</p>
  <p>Can I either</p>
  <ol>
  <li>Pass marker from within the function.</li>
  <li>Or is there a way to change the count of start dynamically in this example?</li>
  </ol>
  <p>P.S. This is the best way that I am able to store my test data currently.</p>
  <p>Here's how i have my testcaseid.marktc defined.
  // testrailthingy.py</p>
  <pre><code>class testcaseid(object):
  
      @staticmethod
      def marktc(*ids):
          return pytest.mark.testrail(ids=ids)
  </code></pre>