code: def test_errors_warnings(logger, tmp_path):
      # test the error for syntax errors in the config file
      (tmp_path / "conf.py").write_text(
          "project = \n", encoding="ascii"
      )
      with pytest.raises(ConfigError) as excinfo:
          Config.read(tmp_path, {}, None)
      assert "conf.py" in str(excinfo.value)
  
      # test the automatic conversion of 2.x only code in configs
      (tmp_path / "conf.py").write_text(
          'project = u"Jägermeister"\n', encoding="utf8"
      )
      cfg = Config.read(tmp_path, {}, None)
      assert cfg.project == "Jägermeister"
      assert logger.called is False
  
imports: import pickle
  import time
  from pathlib import Path
  from unittest import mock
  import pytest
  import sphinx
  from sphinx.builders.gettext import _gettext_compact_validator
  from sphinx.config import ENUM, Config, _Opt, check_confval_types
  from sphinx.deprecation import RemovedInSphinx90Warning
  from sphinx.errors import ConfigError, ExtensionError, VersionRequirementError
label_desc: Use image node_id 10 for calling a global function with example usage: test_errors_warnings(logger, tmp_path) without return types