code: def test_alert_inconsistent_versions(
      tmpdir, cwd_tmpdir, tmp_repo, capsys
  ):
      """Jupytext refuses to sync two inconsistent notebooks"""
      write(
          new_notebook(
              cells=[new_markdown_cell("A short py notebook")]
          ),
          "test.py",
      )
      write(
          new_notebook(
              cells=[new_markdown_cell("Another ipynb notebook")],
              metadata={"jupytext": {"formats": "ipynb,py"}},
          ),
          "test.ipynb",
      )
  
      # Add them both
      tmp_repo.git.add("test.py")
      tmp_repo.git.add("test.ipynb")
  
      # Run jupytext
      status = jupytext(["--sync", "--pre-commit-mode", "test.ipynb"])
  
      # The diff should be visible
      assert status == 1
      out = capsys.readouterr()
      assert (
          """--- test.py
  +++ test.ipynb"""
          in out.err
      )
      assert """-# A short py notebook
  +# Another ipynb notebook
  """
      assert "Error: test.ipynb and test.py are inconsistent" in out.err
      assert "git reset test.py && git checkout -- test.py" in out.err
      assert (
          "git reset test.ipynb && git checkout -- test.ipynb"
          in out.err
      )
  
file_path: jupytext/tests/external/pre_commit/test_pre_commit_mode.py
imports: import os
  import time
  import pytest
  from nbformat.v4.nbbase import new_code_cell, new_markdown_cell, new_notebook
  from jupytext import read, write
  from jupytext.cli import get_timestamp, git_timestamp, is_untracked, jupytext
label_desc: Use image node_id 6 for calling a global function with example usage: test_alert_inconsistent_versions(tmpdir, cwd_tmpdir, tmp_repo, capsys) without return types