docstr: Test that `mkdocs.yml` will be loaded when '--config' is not set.
docstr_tok: ["Test","that","`","mkdocs.yml","`","will","be","loaded","when","'","--","config","'","is","not","set","."]
code: def test_load_default_file_prefer_yml(self, temp_dir):
      """Test that `mkdocs.yml` will be loaded when '--config' is not set."""
      with open(
          os.path.join(temp_dir, "mkdocs.yml"), "w"
      ) as config_file1:
          config_file1.write("site_name: MkDocs Test1\n")
      with open(
          os.path.join(temp_dir, "mkdocs.yaml"), "w"
      ) as config_file2:
          config_file2.write("site_name: MkDocs Test2\n")
  
      os.mkdir(os.path.join(temp_dir, "docs"))
      with change_dir(temp_dir):
          cfg = base.load_config(config_file=None)
          self.assertTrue(isinstance(cfg, defaults.MkDocsConfig))
          self.assertEqual(cfg.site_name, "MkDocs Test1")
  
imports: import os
  import unittest
  from mkdocs import exceptions
  from mkdocs.config import base
  from mkdocs.config import config_options
  from mkdocs.config import defaults
  from mkdocs.config.base import ValidationError
  from mkdocs.tests.base import change_dir, tempdir
label_desc: Use image node_id 6 for calling the ConfigBaseTests obj's underlying member method code with example usage: obj.test_load_default_file_prefer_yml(temp_dir) without return types