| 13 | @pytest.mark.requires_nbconvert |
| 14 | @pytest.mark.skip_on_windows |
| 15 | def test_pipe_nbconvert_execute(tmpdir): |
| 16 | tmp_ipynb = str(tmpdir.join("notebook.ipynb")) |
| 17 | tmp_py = str(tmpdir.join("notebook.py")) |
| 18 | |
| 19 | with open(tmp_py, "w") as fp: |
| 20 | fp.write( |
| 21 | """1 + 2 |
| 22 | """ |
| 23 | ) |
| 24 | |
| 25 | jupytext( |
| 26 | args=[ |
| 27 | tmp_py, |
| 28 | "--to", |
| 29 | "ipynb", |
| 30 | "--pipe-fmt", |
| 31 | "ipynb", |
| 32 | "--pipe", |
| 33 | "jupyter nbconvert --stdin --stdout --to notebook --execute", |
| 34 | ] |
| 35 | ) |
| 36 | |
| 37 | nb = read(tmp_ipynb) |
| 38 | assert len(nb.cells) == 1 |
| 39 | assert nb.cells[0].outputs[0]["data"] == {"text/plain": "3"} |
| 40 | |
| 41 | |
| 42 | @pytest.mark.requires_user_kernel_python3 |