code: def test_read_text_and_combine_with_outputs(tmpdir):
      tmp_ipynb = "notebook.ipynb"
      tmp_script = "notebook.py"
  
      with open(str(tmpdir.join(tmp_script)), "w") as fp:
          fp.write(
              """# ---
  # jupyter:
  #   jupytext_formats: ipynb,py:light
  # ---
  
  1+1
  
  2+2
  
  3+3
  """
          )
  
      with open(str(tmpdir.join(tmp_ipynb)), "w") as fp:
          fp.write(
              """{
   "cells": [
    {
     "cell_type": "code",
     "execution_count": 1,
     "metadata": {},
     "outputs": [
      {
       "data": {
        "text/plain": [
         "2"
        ]
       },
       "execution_count": 1,
       "metadata": {},
       "output_type": "execute_result"
      }
     ],
     "source": [
      "1+1"
     ]
    },
    {
     "cell_type": "code",
     "execution_count": 3,
     "metadata": {},
     "outputs": [
      {
       "data": {
        "text/plain": [
         "6"
        ]
       },
       "execution_count": 3,
       "metadata": {},
       "output_type": "execute_result"
      }
     ],
     "source": [
      "3+3"
     ]
    }
   ],
   "metadata": {},
   "nbformat": 4,
   "nbformat_minor": 2
  }
  """
          )
  
      # create contents manager
      cm = jupytext.TextFileContentsManager()
      cm.root_dir = str(tmpdir)
  
      # load notebook from script
      model = cm.get(tmp_script)
      nb = model["content"]
  
      assert nb.cells[0]["source"] == "1+1"
      assert nb.cells[1]["source"] == "2+2"
      assert nb.cells[2]["source"] == "3+3"
  
      # No output for the second cell, which is not in the ipynb
      assert nb.cells[0]["outputs"]
      assert not nb.cells[1]["outputs"]
      assert nb.cells[2]["outputs"]
  
      assert len(nb.cells) == 3
  
file_path: jupytext/tests/functional/others/test_combine.py
imports: from copy import deepcopy
  from nbformat.v4.nbbase import new_code_cell, new_markdown_cell, new_notebook
  import jupytext
  from jupytext.combine import combine_inputs_with_outputs
  from jupytext.compare import compare, compare_notebooks
label_desc: Use image node_id 2 for calling a global function with example usage: test_read_text_and_combine_with_outputs(tmpdir) without return types