title: Is there a way to skip a pytest fixture?
body: <p>The problem is my given fixture function has an external dependency and that is causing an "Error" (like unreachable network / insufficient resource etc).</p>
  
  <p>I'd like to skip the fixture and there by skip any test that depends on this fixture.</p>
  
  <p>Doing something like this wont work:</p>
  
  <pre><code>import pytest
  
  @pytest.mark.skip(reason="Something.")
  @pytest.fixture(scope="module")
  def parametrized_username():
      raise Exception("foobar")
      return 'overridden-username'
  </code></pre>
  
  <p>this will result in </p>
  
  <pre><code>_______________________________ ERROR at setup of test_username _______________________________
  
      @pytest.mark.skip(reason="Something.")
      @pytest.fixture(scope="module")
      def parametrized_username():
  &gt;       raise Exception("foobar")
  E       Exception: foobar
  
  a2.py:6: Exception
  </code></pre>
  
  <p>What's the right away to skip a pytest fixture?</p>