code: def test_engine_kwargs_append_invalid(ext):
      # GH 43445
      # test whether an invalid engine kwargs actually raises
      with tm.ensure_clean(ext) as f:
          DataFrame(["hello", "world"]).to_excel(f)
          with pytest.raises(
              TypeError,
              match=re.escape(
                  "load_workbook() got an unexpected keyword argument 'apple_banana'"
              ),
          ):
              with ExcelWriter(
                  f,
                  engine="openpyxl",
                  mode="a",
                  engine_kwargs={"apple_banana": "fruit"},
              ) as writer:
                  # ExcelWriter needs us to write something to close properly
                  DataFrame(["good"]).to_excel(
                      writer, sheet_name="Sheet2"
                  )
  
imports: import contextlib
  from pathlib import Path
  import re
  import numpy
  import pytest
  import pandas
  from pandas import DataFrame
  import pandas._testing
  from pandas.io.excel import ExcelWriter, _OpenpyxlWriter
  from pandas.io.excel._openpyxl import OpenpyxlReader
label_desc: Use image node_id 5 for calling a global function with example usage: test_engine_kwargs_append_invalid(ext) without return types