pytest to insert caplog fixture in test method
问题 I have the following test class for pytest: 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