code: def test_run_completed_event(run):
      observer = run.observers[0]
      run()
      observer.completed_event.assert_called_with(
          stop_time=run.stop_time, result=run.result
      )
  
imports: from datetime import datetime
  import mock
  import os
  import pytest
  import tempfile
  import sys
  from sacred.run import Run
  from sacred.config.config_summary import ConfigSummary
  from sacred.utils import ObserverError, SacredInterrupt, TimeoutInterrupt, apply_backspaces_and_linefeeds
label_desc: Use image node_id 9 for calling a global function with example usage: test_run_completed_event(run) without return types