code: def test_preferred_jupytext_formats_save(tmpdir):
      tmpdir.join(".jupytext.yml").write(
          "preferred_jupytext_formats_save: jl:percent"
      )
      tmp_ipynb = tmpdir.join("notebook.ipynb")
      tmp_jl = tmpdir.join("notebook.jl")
  
      nb = new_notebook(
          cells=[new_code_cell("1 + 1")],
          metadata={"jupytext": {"formats": "ipynb,jl"}},
      )
  
      write(nb, str(tmp_ipynb))
      jupytext([str(tmp_ipynb), "--sync"])
  
      with open(str(tmp_jl)) as stream:
          text_jl = stream.read()
  
      # Parse the YAML header
      metadata, _, _, _ = header_to_metadata_and_cell(
          text_jl.splitlines(), "#", ""
      )
      assert metadata["jupytext"]["formats"] == "ipynb,jl:percent"
  
file_path: jupytext/tests/functional/cli/test_cli_config.py
imports: import nbformat
  import pytest
  from nbformat.v4.nbbase import new_code_cell, new_notebook
  from jupytext.cli import jupytext
  from jupytext.compare import compare
  from jupytext.header import header_to_metadata_and_cell
  from jupytext.jupytext import read, write
label_desc: Use image node_id 5 for calling a global function with example usage: test_preferred_jupytext_formats_save(tmpdir) without return types