title: How to mark one function not a test for pytest?
body: <p>I'm using pytest to test some code based on TensorFlow.</p>
  
  <p>A <code>TestCase</code> is defined for simplicity like:</p>
  
  <pre><code>class TestCase(tf.test.TestCase):
      # ...
  </code></pre>
  
  <p>The problem is <code>tf.test.TestCase</code> provide a useful function <code>self.test_session()</code>, which was treated as a test method in pytest since its name starts with <code>test_</code>.</p>
  
  <p>The result pytest report more succeed tests than test methods I defined due to <code>test_session()</code> methods.</p>
  
  <p>I use the following code to skip <code>test_session</code>:</p>
  
  <pre><code>class TestCase(tf.test.TestCase):
      @pytest.mark.skip
      @contextmanager
      def test_session(self):
          with super().test_session() as sess:
              yield sess
  </code></pre>
  
  <p>However there would be some "s" in test report indicating there are some skip tests.</p>
  
  <p>Is there anyway I can mark one exact method not a test method without changing pytest test discovery rules globally?</p>