title: Parametrize class tests with pytest
body: <p>I have an array of objects that I need to run for each test inside my test class. I want to parametrize every test function in a TestClass. The end goal is to have something resembling:</p>
  
  <pre><code>@pytest.mark.parametrize('test_input', [1, 2, 3, 4])
  class TestClass:
      def test_something1(self, test_input):
          # test code here, runs each time for the parametrize
  </code></pre>
  
  <p>But from my understanding, you can't pass input parameters, or at least call <code>@pytest.mark.parametrize</code> on a class, those markers are meant for <code>defs</code> not <code>class</code>s</p>
  
  <p>What I have now:</p>
  
  <pre><code>class TestClass:
      def test_something1(self):
          for i in stuff:
              # test code here
  
      def test_something2(self):
          for i in stuff:
              # test code here
      ...
  </code></pre>
  
  <p><strong>Is there a way to pass the parametrize a class itself or every function inside the TestClass?</strong> Maybe a <code>@pytest.mark.parametrize</code> inside a <code>@pytest.fixture...(autouse=True).</code></p>
  
  <p>I want to keep my tests organized as a class because it mirrors the file that I'm testing. Because I loop through these objects in at least a dozen different tests, it would be easier to call a loop of the class than in each <code>def</code>.</p>