code: def test_output_file_when_changing_directory(self):
      with temp_dir() as tmpdir, change_cwd(tmpdir):
          os.mkdir("dest")
          with open("demo.py", "w", encoding="utf-8") as f:
              f.write('import os; os.chdir("dest")')
  
          assert_python_ok(
              "-m",
              self.profilermodule.__name__,
              "-o",
              "out.pstats",
              "demo.py",
          )
  
          self.assertTrue(os.path.exists("out.pstats"))
  
imports: import sys
  import pstats
  import unittest
  import os
  from difflib import unified_diff
  from io import StringIO
  from test.support.os_helper import TESTFN, unlink, temp_dir, change_cwd
  from contextlib import contextmanager
  import profile
  from test.profilee import testfunc, timer
  from test.support.script_helper import assert_python_failure, assert_python_ok
label_desc: Use image node_id 9 for calling the ProfileTest obj's underlying member method code with example usage: obj.test_output_file_when_changing_directory() without return types