def test_buffersInBlock(self):
        """
        The context manager's logger does not log to provided observer
        inside the block.
        """
        with self.logBuffer as logger:
            logger.info("An event")
            self.assertFalse(self.events)

        The context manager's logger does not log to provided observer
        inside the block.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/test/test_tcp.py