title: pytest to insert caplog fixture in test method
body: <p>I have the following test class for pytest:</p>
  
  <pre><code>class TestConnection(AsyncTestCase):
        '''Integration test'''
  
        @gen_test
        def test_connecting_to_server(self):
            '''Connecting to the TCPserver'''
            client = server = None
            try:
                sock, port = bind_unused_port()
                with NullContext():
                    server = EchoServer()
                    server.add_socket(sock)
                client = IOStream(socket.socket())
  
                #### HERE I WANT TO HAVE THE caplog FIXTURE
  
                with ExpectLog(app_log, '.*decode.*'):
                    yield client.connect(('localhost', port))
                    yield client.write(b'hello\n')
                    # yield client.read_until(b'\n')
                    yield gen.moment
                    assert False
            finally:
                if server is not None:
                    server.stop()
                if client is not None:
                    client.close()
  </code></pre>
  
  <p>Within this class apparently ExpectLog is not working so after a day of digging around in pytest's documentation I found that there is this caplog fixture that you can have inserted in you methods in order to access the captured logs. It seems to work if I have a test function to which I add the caplog argument but how do I make the caplog fixture available within the methods of a test class like the one above?</p>