code: def test_config_check():
      if "moviepy.config" in sys.modules:
          del sys.modules["moviepy.config"]
  
      try:
          dotenv_module = importlib.import_module("dotenv")
      except ImportError:
          dotenv_module = None
      else:
          with open(".env", "w") as f:
              f.write("")
  
      moviepy_config_module = importlib.import_module("moviepy.config")
  
      stdout = io.StringIO()
      with contextlib.redirect_stdout(stdout):
          moviepy_config_module.check()
  
      output = stdout.getvalue()
  
      assert "MoviePy: ffmpeg successfully found in" in output
      assert "MoviePy: ImageMagick successfully found in" in output
  
      if dotenv_module:
          assert os.path.isfile(".env")
          os.remove(".env")
          assert ".env file content at" in output
          del sys.modules["dotenv"]
  
      if "moviepy.config" in sys.modules:
          del sys.modules["moviepy.config"]
  
file_path: moviepy/tests/test_tools.py
imports: import contextlib
  import filecmp
  import importlib
  import io
  import os
  import shutil
  import sys
  import pytest
  import moviepy.tools
  from moviepy.video.io.downloader import download_webfile
label_desc: Use image node_id 9 for calling a global function with example usage: test_config_check() without return types