code: def test_auto_in_formats(ipynb_py_R_jl_file):
      if any(
          pattern in ipynb_py_R_jl_file
          for pattern in ["plotly", "julia"]
      ):
          pytest.skip()
      nb = read(ipynb_py_R_jl_file)
      nb.metadata["jupytext"] = {"formats": "ipynb,auto:percent"}
      fmt = auto_ext_from_metadata(nb.metadata)[1:] + ":percent"
      expected_formats = "ipynb," + fmt
  
      text = writes(nb, "ipynb")
      assert "auto" not in text
      nb2 = reads(text, "ipynb")
      assert nb2.metadata["jupytext"]["formats"] == expected_formats
  
      text = writes(nb, "auto:percent")
      assert "auto" not in text
      nb2 = reads(text, fmt)
      assert nb2.metadata["jupytext"]["formats"] == expected_formats
  
      del nb.metadata["language_info"]
      del nb.metadata["kernelspec"]
      with pytest.raises(JupytextFormatError):
          writes(nb, "ipynb")
      with pytest.raises(JupytextFormatError):
          writes(nb, "auto:percent")
  
imports: import pytest
  from jupytext import read, reads, writes
  from jupytext.formats import JupytextFormatError, auto_ext_from_metadata
label_desc: Use image node_id 3 for calling a global function with example usage: test_auto_in_formats(ipynb_py_R_jl_file) without return types