third_party/blink/tools/blinkpy/common/system/log_testing.py
def assertMessages(self, messages):
        """Asserts the current array of log messages, and clear its contents.

        We clear the log messages after asserting since they are no longer
        needed after asserting.  This serves two purposes: (1) it simplifies
        the calling code when we want to check multiple logging calls in a
        single test method, and (2) it lets us check in the tearDown() method
        that there are no remaining log messages to be asserted.

        The latter ensures that no extra log messages are getting logged that
        the caller might not be aware of or may have forgotten to check for.
        This gets us a bit more mileage out of our tests without writing any
        additional code.

        We want to clear the array of messages even in the case of
        an Exception (e.g. an AssertionError).  Otherwise, another
        AssertionError can occur in the tearDown() because the
        array might not have gotten emptied.

        Args:
            messages: A list of log message strings.
        """
        try:
            self._test_stream.assertMessages(messages)
        finally:
            self._test_stream.messages = []
Asserts the current array of log messages, and clear its contents.

        We clear the log messages after asserting since they are no longer
        needed after asserting.  This serves two purposes: (1) it simplifies
        the calling code when we want to check multiple logging calls in a
        single test method, and (2) it lets us check in the tearDown() method
        that there are no remaining log messages to be asserted.

        The latter ensures that no extra log messages are getting logged that
        the caller might not be aware of or may have forgotten to check for.
        This gets us a bit more mileage out of our tests without writing any
        additional code.

        We want to clear the array of messages even in the case of
        an Exception (e.g. an AssertionError).  Otherwise, another
        AssertionError can occur in the tearDown() because the
        array might not have gotten emptied.

        Args:
            messages: A list of log message strings.
        
Asserts the current array of log messages, and clear its contents.
We clear the log messages after asserting since they are no longer
needed after asserting.  This serves two purposes: (1) it simplifies
the calling code when we want to check multiple logging calls in a
single test method, and (2) it lets us check in the tearDown() method
that there are no remaining log messages to be asserted.

The latter ensures that no extra log messages are getting logged that
the caller might not be aware of or may have forgotten to check for.
This gets us a bit more mileage out of our tests without writing any
additional code.

We want to clear the array of messages even in the case of
an Exception .  Otherwise, another
AssertionError can occur in the tearDown() because the
array might not have gotten emptied.
Asserts the current array of log messages and clear its contents . We clear the log messages after asserting since they are no longer needed after asserting . This serves two purposes : ( 1 ) it simplifies the calling code when we want to check multiple logging calls in a single test method and ( 2 ) it lets us check in the tearDown () method that there are no remaining log messages to be asserted . The latter ensures that no extra log messages are getting logged that the caller might not be aware of or may have forgotten to check for . This gets us a bit more mileage out of our tests without writing any additional code . We want to clear the array of messages even in the case of an Exception . Otherwise another AssertionError can occur in the tearDown () because the array might not have gotten emptied .
def assertMessages(self, messages):
        try:
            self._test_stream.assertMessages(messages)
        finally:
            self._test_stream.messages = []
def assertMessages ( self , messages ) : try : self . _test_stream . assertMessages ( messages ) finally : self . _test_stream . messages = [ ]
Asserts the current array of log messages, and clear its contents.
Asserts the current array of log messages and clear its contents .
"""Asserts the current array of log messages, and clear its contents.

        We clear the log messages after asserting since they are no longer
        needed after asserting.  This serves two purposes: (1) it simplifies
        the calling code when we want to check multiple logging calls in a
        single test method, and (2) it lets us check in the tearDown() method
        that there are no remaining log messages to be asserted.

        The latter ensures that no extra log messages are getting logged that
        the caller might not be aware of or may have forgotten to check for.
        This gets us a bit more mileage out of our tests without writing any
        additional code.

        We want to clear the array of messages even in the case of
        an Exception (e.g. an AssertionError).  Otherwise, another
        AssertionError can occur in the tearDown() because the
        array might not have gotten emptied.

        Args:
            messages: A list of log message strings.
        """
self
messages
A list of log message strings.
A list of log message strings .