From a0164dc512164fd2f4726e1c7d678bc60b3d07ef Mon Sep 17 00:00:00 2001 From: Marc Wouts Date: Sun, 12 Apr 2020 00:08:35 +0200 Subject: [PATCH] Skip the tests for `jupytext --execute` if a timeout occurs (#489) --- CHANGELOG.md | 3 +++ tests/test_execute.py | 24 ++++++++++++++++++------ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b336d6e66..9ec2f7c9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ Next release (2020-04-??) - Jupytext is tested in `pip` and `conda` environments, on Linux, Mac OS and Windows, using Github actions (#487) - Documented that the YAML header can be created with either `--set-kernel`, `--set-formats`, or both (#485) +**Fixed** +- Skip the `jupytext --execute` tests when the warning _Timeout waiting for IOPub output_ occurs, which is the case intermittently on Windows (#489) + 1.4.2 (2020-04-05) ------------------ diff --git a/tests/test_execute.py b/tests/test_execute.py index 6a9c0b984..0fc39863f 100644 --- a/tests/test_execute.py +++ b/tests/test_execute.py @@ -5,7 +5,7 @@ @requires_nbconvert -def test_pipe_nbconvert_execute(tmpdir): +def test_pipe_nbconvert_execute(tmpdir, caplog): tmp_ipynb = str(tmpdir.join('notebook.ipynb')) tmp_py = str(tmpdir.join('notebook.py')) @@ -15,6 +15,8 @@ def test_pipe_nbconvert_execute(tmpdir): jupytext(args=[tmp_py, '--to', 'ipynb', '--pipe-fmt', 'ipynb', '--pipe', 'jupyter nbconvert --stdin --stdout --to notebook --execute']) + if "Timeout" in caplog.text: + pytest.skip(caplog.text) # Issue 489 nb = read(tmp_ipynb) assert len(nb.cells) == 1 @@ -22,7 +24,7 @@ def test_pipe_nbconvert_execute(tmpdir): @requires_nbconvert -def test_pipe_nbconvert_execute_sync(tmpdir): +def test_pipe_nbconvert_execute_sync(tmpdir, caplog): tmp_ipynb = str(tmpdir.join('notebook.ipynb')) tmp_py = str(tmpdir.join('notebook.py')) @@ -32,6 +34,8 @@ def test_pipe_nbconvert_execute_sync(tmpdir): jupytext(args=[tmp_py, '--set-formats', 'py,ipynb', '--sync', '--pipe-fmt', 'ipynb', '--pipe', 'jupyter nbconvert --stdin --stdout --to notebook --execute']) + if "Timeout" in caplog.text: + pytest.skip(caplog.text) # Issue 489 nb = read(tmp_ipynb) assert len(nb.cells) == 1 @@ -39,7 +43,7 @@ def test_pipe_nbconvert_execute_sync(tmpdir): @requires_nbconvert -def test_execute(tmpdir): +def test_execute(tmpdir, caplog): tmp_ipynb = str(tmpdir.join('notebook.ipynb')) tmp_py = str(tmpdir.join('notebook.py')) @@ -48,6 +52,8 @@ def test_execute(tmpdir): """) jupytext(args=[tmp_py, '--to', 'ipynb', '--execute']) + if "Timeout" in caplog.text: + pytest.skip(caplog.text) # Issue 489 nb = read(tmp_ipynb) assert len(nb.cells) == 1 @@ -89,7 +95,7 @@ def test_execute_readme_not_ok(tmpdir): @requires_nbconvert -def test_execute_sync(tmpdir): +def test_execute_sync(tmpdir, caplog): tmp_ipynb = str(tmpdir.join('notebook.ipynb')) tmp_py = str(tmpdir.join('notebook.py')) @@ -98,6 +104,8 @@ def test_execute_sync(tmpdir): """) jupytext(args=[tmp_py, '--set-formats', 'py,ipynb', '--sync', '--execute']) + if "Timeout" in caplog.text: + pytest.skip(caplog.text) # Issue 489 nb = read(tmp_ipynb) assert len(nb.cells) == 1 @@ -106,7 +114,7 @@ def test_execute_sync(tmpdir): @requires_nbconvert @requires_ir_kernel -def test_execute_r(tmpdir): # pragma: no cover +def test_execute_r(tmpdir, caplog): # pragma: no cover tmp_ipynb = str(tmpdir.join('notebook.ipynb')) tmp_md = str(tmpdir.join('notebook.md')) @@ -117,6 +125,8 @@ def test_execute_r(tmpdir): # pragma: no cover """) jupytext(args=[tmp_md, '--to', 'ipynb', '--execute']) + if "Timeout" in caplog.text: + pytest.skip(caplog.text) # Issue 489 nb = read(tmp_ipynb) assert len(nb.cells) == 1 @@ -124,7 +134,7 @@ def test_execute_r(tmpdir): # pragma: no cover @requires_nbconvert -def test_execute_in_subfolder(tmpdir): +def test_execute_in_subfolder(tmpdir, caplog): tmpdir.mkdir('subfolder') tmp_csv = str(tmpdir.join('subfolder', 'inputs.csv')) @@ -144,6 +154,8 @@ def test_execute_in_subfolder(tmpdir): """) jupytext(args=[tmp_py, '--to', 'ipynb', '--execute']) + if "Timeout" in caplog.text: + pytest.skip(caplog.text) # Issue 489 nb = read(tmp_ipynb) assert len(nb.cells) == 3