class_docstr: Context manager for testing that code prints certain text.
  
  Examples
  --------
  >>> with AssertPrints("abc", suppress=False):
  ...     print("abcd")
  ...     print("def")
  ... 
  abcd
  def
class_docstr_tok: ["Context","manager","for","testing","that","code","prints","certain","text",".","Examples","--","--","--","--",">",">",">","with","AssertPrints","(","``","abc","''",",","suppress=False",")",":","...","print","(","``","abcd","''",")","...","print","(","``","def","''",")","...","abcd","def"]
code: def __init__(self, s, channel="stdout", suppress=True):
      self.s = s
      if isinstance(self.s, (py3compat.string_types, _re_type)):
          self.s = [self.s]
      self.channel = channel
      self.suppress = suppress
  
imports: from __future__ import absolute_import
  import os
  import re
  import sys
  import tempfile
  from contextlib import contextmanager
  from io import StringIO
  from subprocess import Popen, PIPE
  from traitlets.config.loader import Config
  from IPython.utils.process import get_output_error_code
  from IPython.utils.text import list_strings
  from IPython.utils.io import temp_pyfile, Tee
  from IPython.utils import py3compat
  from IPython.utils.encoding import DEFAULT_ENCODING
  from .None import decorators
  from .None import skipdoctest
label_desc: Use image node_id 1 to create a new AssertPrints object from inherited base classes: object with example: obj = AssertPrints(s, channel, suppress)