title: pytest-xdist indirect fixtures with class scope
body: <p>I have some complicated and heavy logic to build a test object and the tests are very long running. They are integration tests and I wanted to try and parallelize them a bit. So i found the pytest-xdist library.</p>
  
  <p>Because of the heavy nature of building the test object, I am using pytests indirection capability on fixtures to build them at test time rather than at collection. Some code I am using for testing can be found below.</p>
  
  <pre><code>#run.py
  import pytest
  
  @pytest.mark.parametrize("attribute",(
      ["pid1", ["pod1", "pod2", "pod3"]],
      ["pid2", ["pod2", "pod4", "pod5"]]
  ), indirect=True)
  class TestSampleWithScenarios(object):
      @pytest.fixture(scope="class")
      def attribute(request):
          # checkout the pod here
          # build the device object and yield
          device = {}
          yield device
          # teardown the device object
          # release pod
  
  
      def test_demo1(self, attribute):
          assert isinstance(attribute, str)
  
      def test_demo2(self, attribute):
          assert isinstance(attribute, str)
  </code></pre>
  
  <p>My run command is currently <code>pytest run.py -n 4 --dist=loadscope</code></p>
  
  <p>When I do no use loadscope, all the tests are sent to their own worker. I do not want this because I would like to only build the device object once and use it for all related tests.</p>
  
  <p>When I use loadscope, all the tests are executed against gw0 and I am not getting any parallelism. </p>
  
  <p>I am wondering if there is any tweaks that I am missing or is this functionality not implemented currently.</p>