code: def test_rich_print():
      console = rich.get_console()
      output = io.StringIO()
      backup_file = console.file
      try:
          console.file = output
          rich.print("foo", "bar")
          rich.print("foo\n")
          rich.print("foo\n\n")
          assert output.getvalue() == "foo bar\nfoo\n\nfoo\n\n\n"
      finally:
          console.file = backup_file
  
file_path: rich/tests/test_rich_print.py
imports: import io
  import json
  import rich
  from rich.console import Console
label_desc: Use image node_id 3 for calling a global function with example usage: test_rich_print() without return types