| 43 | @pytest.mark.requires_nbconvert |
| 44 | @pytest.mark.skip_on_windows |
| 45 | def test_pipe_nbconvert_execute_sync(tmpdir): |
| 46 | tmp_ipynb = str(tmpdir.join("notebook.ipynb")) |
| 47 | tmp_py = str(tmpdir.join("notebook.py")) |
| 48 | |
| 49 | with open(tmp_py, "w") as fp: |
| 50 | fp.write( |
| 51 | """1 + 2 |
| 52 | """ |
| 53 | ) |
| 54 | |
| 55 | jupytext( |
| 56 | args=[ |
| 57 | tmp_py, |
| 58 | "--set-formats", |
| 59 | "py,ipynb", |
| 60 | "--sync", |
| 61 | "--pipe-fmt", |
| 62 | "ipynb", |
| 63 | "--pipe", |
| 64 | "jupyter nbconvert --stdin --stdout --to notebook --execute", |
| 65 | ] |
| 66 | ) |
| 67 | |
| 68 | nb = read(tmp_ipynb) |
| 69 | assert len(nb.cells) == 1 |
| 70 | assert nb.cells[0].outputs[0]["data"] == {"text/plain": "3"} |
| 71 | |
| 72 | |
| 73 | @pytest.mark.requires_user_kernel_python3 |