title: Managing many session-scoped fixtures in pytest
body: <p>I have a below code in my conftest.py</p>
  
  <pre><code>import pytest
  
  @pytest.fixture(scope="class")
  def fix1():
     print("i am in fix1")
     a = 10
     return a
  
  @pytest.fixture(scope="class")
  def fix2():
     print("i am in fix2")
     b = 20
    return b
  
  @pytest.fixture(scope="session",autouse=True)
  def setup_session(request):
      tp = TestSetup(fix1)
      tp.setup()
      def teardown_session():
        tp.teardown()
      request.addfinalizer(teardown_session)
  
  class TestSetup(object):
      def __init__(self, fix1, fix2):
          self.fix1 = fix1
          self.fix2 = fix2
      def setup(self):
          print("i am in setup")
          print(self.fix1)
     def teardown(self):
         print("I am in teardown")
         print(self.fix2)
  
     # py.test -s test1.py 
     =========== test session starts ===========
     platform linux2 -- Python 2.7.5, pytest-2.8.5, py-1.4.31, pluggy-0.3.1
     rootdir: /tmp/test, inifile: 
     collected 2 items 
  
     test1.py i am in setup
     &lt;function fix1 at 0x2948320&gt;
     i am in test1
     .i am in test2
     .I am in teardown
  </code></pre>
  
  <p>when i execute the above using pytest, the fixtures fix1 and fix2 are never called. I need a way to call fix1 and fix2 as part of of setup and teardown before any of my tests runs.</p>
  
  <p>What i am a trying to achieve is before any of my test runs, i need to have a setup created, the fix1, and fix2 are fixture which setup few things . I would like to have these fixture be called before any of my test runs and once all the tests are run , i call teardown function to teardown my setup.</p>