title: Can pytest hooks use fixtures?
body: <p>I know fixtures can use other fixtures, but can a hook use a fixture? I searched a lot on net but could not get any help. Can someone please point if I am doing any mistake here? </p>
  
  <pre><code>#conftest.py
  
  @pytest.fixture()
  def json_loader(request):   
      """Loads the data from given JSON file"""
      def _loader(filename):
          import json
          with open(filename, 'r') as f:
              data = json.load(f)
          return data
      return _loader
  
  
  
  def pytest_runtest_setup(item,json_loader): #hook fails to use json_loader
      data = json_loader("some_file.json") 
      print(data) 
      #do something useful here with data
  </code></pre>
  
  <p>I get the following error when I run it.</p>
  
  <p>pluggy.manager.PluginValidationError: Plugin 'C:\some_path\conftest.py' for hook 'pytest_runtest_setup'
  hookimpl definition: pytest_runtest_setup(item, json_loader)
  Argument(s) {'json_loader'} are declared in the hookimpl but can not be found in the hookspec</p>
  
  <p>Even if I do not pass json_loader as an arg to pytest_runtest_setup(), I get an error saying "Fixture "json_loader" called directly. Fixtures are not meant to be called directly"</p>