code: def test_write_wrong_ext(tmpdir, nb_file="notebook.ext"):
      nb_file = str(tmpdir.join(nb_file))
      with pytest.raises(JupytextFormatError):
          jupytext.write(new_notebook(), nb_file)
  
imports: import pytest
  from nbformat.v4.nbbase import new_notebook
  import jupytext
  from jupytext.formats import JupytextFormatError
label_desc: Use image node_id 2 for calling a global function with example usage: test_write_wrong_ext(tmpdir, nb_file) without return types