def test_load_from_open_file(self, temp_path):
        """`load_config` can accept an open file descriptor."""
        config_fname = os.path.join(temp_path, 'mkdocs.yml')
        config_file = open(config_fname, 'w+')
        config_file.write("site_name: MkDocs Test\n")
        config_file.flush()
        os.mkdir(os.path.join(temp_path, 'docs'))

        cfg = base.load_config(config_file=config_file)
        self.assertTrue(isinstance(cfg, defaults.MkDocsConfig))
        self.assertEqual(cfg.site_name, 'MkDocs Test')
        # load_config will always close the file
        self.assertTrue(config_file.closed)
`load_config` can accept an open file descriptor.
mkdocs/tests/config/base_tests.py