code: def test_captured_out_filter(ex, capsys):
      @ex.main
      def run_print_mock_progress():
          sys.stdout.write("progress 0")
          sys.stdout.flush()
          for i in range(10):
              sys.stdout.write("\b")
              sys.stdout.write("{}".format(i))
              sys.stdout.flush()
  
      ex.captured_out_filter = apply_backspaces_and_linefeeds
      # disable logging and set capture mode to python
      options = {"--loglevel": "CRITICAL", "--capture": "sys"}
      with capsys.disabled():
          assert ex.run(options=options).captured_out == "progress 9"
  
imports: from sacred import Ingredient
  from mock import patch
  import pytest
  import sys
  from sacred import cli_option
  from sacred import host_info_gatherer
  from sacred.experiment import Experiment
  from sacred.utils import apply_backspaces_and_linefeeds, ConfigAddedError, SacredError
label_desc: Use image node_id 14 for calling a global function with example usage: test_captured_out_filter(ex, capsys) without return types