class_docstr: Mock logging handler to check for expected logs used by
  LoggingComparisonTestCase.
  
  Messages are available from an instance's ``messages`` dict, in
  order, indexed by a lowercase log level string (e.g., 'debug',
  'info', etc.).
class_docstr_tok: ["Mock","logging","handler","to","check","for","expected","logs","used","by","LoggingComparisonTestCase",".","Messages","are","available","from","an","instance","'s","``","messages","``","dict",",","in","order",",","indexed","by","a","lowercase","log","level","string","(","e.g.",",","'debug","'",",","'info","'",",","etc",".",")","."]
docstr: Assert that the last line captured at the given level contains a
  particular substring.
docstr_tok: ["Assert","that","the","last","line","captured","at","the","given","level","contains","a","particular","substring","."]
code: def assertContains(self, level, substring):
      """
      Assert that the last line captured at the given level contains a
      particular substring.
      """
      msg = "\n\n{method}: {last_line}\ndoes not contain:\n{substring}"
      last_line = self.tail(level, n=1)
      if len(last_line) == 0:
          raise AssertionError(
              "Missing {method} output: {substring}".format(
                  method=self.param_methods[level],
                  substring=repr(substring),
              )
          )
      if substring not in last_line[0]:
          raise AssertionError(
              msg.format(
                  method=self.param_methods[level],
                  last_line=repr(last_line[0]),
                  substring=repr(substring),
              )
          )
      else:
          self.messages[level].pop(-1)
  
file_path: holoviews/holoviews/tests/utils.py
imports: import logging
  import os
  import sys
  import param
  from holoviews.element.comparison import ComparisonTestCase
label_desc: Use image node_id 6 for calling the MockLoggingHandler obj's underlying member method code with example usage: obj.assertContains(level, substring) without return types