code: def test_local_config_overrides_cm_config(tmpdir):
      cm = jupytext.TextFileContentsManager()
      cm.root_dir = str(tmpdir)
      cm.formats = "ipynb,py"
  
      nested = tmpdir.mkdir("nested")
      with open(str(nested.join("jupytext.yml")), "w") as fp:
          fp.write("formats: ''\n")
  
      cm.save(notebook_model(SAMPLE_NOTEBOOK), "notebook.ipynb")
      assert os.path.isfile(str(tmpdir.join("notebook.ipynb")))
      assert os.path.isfile(str(tmpdir.join("notebook.py")))
  
      cm.save(notebook_model(SAMPLE_NOTEBOOK), "nested/notebook.ipynb")
      assert os.path.isfile(str(nested.join("notebook.ipynb")))
      assert not os.path.isfile(str(nested.join("notebook.py")))
  
imports: import logging
  import os
  import sys
  import unittest.mock
  import pytest
  from nbformat import read
  from nbformat.v4.nbbase import new_code_cell, new_markdown_cell, new_notebook
  from tornado.web import HTTPError
  import jupytext
  from jupytext import TextFileContentsManager
  from jupytext.compare import compare_cells, notebook_model
label_desc: Use image node_id 1 for calling a global function with example usage: test_local_config_overrides_cm_config(tmpdir) without return types