From 60382fc48afc478858b34c87f40ea6d5aa5d0b8f Mon Sep 17 00:00:00 2001 From: Marc Wouts Date: Wed, 9 Feb 2022 14:50:45 +0100 Subject: [PATCH] These tests require a python kernel --- tests/test_cli.py | 6 ++++++ tests/test_execute.py | 14 +++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/tests/test_cli.py b/tests/test_cli.py index 4c5be554b..7ebd6f8b0 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -439,6 +439,7 @@ def test_update_metadata(py_file, tmpdir, capsys): assert "invalid" in err +@requires_user_kernel_python3 @pytest.mark.parametrize("py_file", list_notebooks("python")) def test_set_kernel_inplace(py_file, tmpdir): tmp_py = str(tmpdir.join("notebook.py")) @@ -453,6 +454,7 @@ def test_set_kernel_inplace(py_file, tmpdir): assert cmd == "python" or os.path.samefile(cmd, sys.executable) +@requires_user_kernel_python3 @pytest.mark.parametrize("py_file", list_notebooks("python")) def test_set_kernel_auto(py_file, tmpdir): tmp_py = str(tmpdir.join("notebook.py")) @@ -468,6 +470,7 @@ def test_set_kernel_auto(py_file, tmpdir): assert cmd == "python" or os.path.samefile(cmd, sys.executable) +@requires_user_kernel_python3 @pytest.mark.parametrize("py_file", list_notebooks("python")) def test_set_kernel_with_name(py_file, tmpdir): tmp_py = str(tmpdir.join("notebook.py")) @@ -673,6 +676,7 @@ def test_cli_can_infer_jupytext_format_from_stdin(nb_file, tmpdir, cwd_tmpdir): compare_notebooks(nb2, nb, "Rmd") +@requires_user_kernel_python3 def test_set_kernel_works_with_pipes_326(capsys): md = """```python 1 + 1 @@ -687,6 +691,7 @@ def test_set_kernel_works_with_pipes_326(capsys): assert "kernelspec" in nb.metadata +@requires_user_kernel_python3 @skip_on_windows @pytest.mark.filterwarnings("ignore") def test_utf8_out_331(capsys, caplog): @@ -1018,6 +1023,7 @@ def test_create_header_with_set_formats(format_name, cwd_tmpdir, tmpdir): assert nb["metadata"]["jupytext"]["formats"] == format_name +@requires_user_kernel_python3 @requires_myst @requires_pandoc @pytest.mark.parametrize( diff --git a/tests/test_execute.py b/tests/test_execute.py index a6037b872..ecc7ab6e8 100644 --- a/tests/test_execute.py +++ b/tests/test_execute.py @@ -5,9 +5,15 @@ from jupytext import read from jupytext.cli import jupytext -from .utils import requires_ir_kernel, requires_nbconvert, skip_on_windows +from .utils import ( + requires_ir_kernel, + requires_nbconvert, + requires_user_kernel_python3, + skip_on_windows, +) +@requires_user_kernel_python3 @requires_nbconvert @skip_on_windows def test_pipe_nbconvert_execute(tmpdir): @@ -37,6 +43,7 @@ def test_pipe_nbconvert_execute(tmpdir): assert nb.cells[0].outputs[0]["data"] == {"text/plain": "3"} +@requires_user_kernel_python3 @requires_nbconvert @skip_on_windows def test_pipe_nbconvert_execute_sync(tmpdir): @@ -67,6 +74,7 @@ def test_pipe_nbconvert_execute_sync(tmpdir): assert nb.cells[0].outputs[0]["data"] == {"text/plain": "3"} +@requires_user_kernel_python3 @requires_nbconvert @skip_on_windows def test_execute(tmpdir, caplog, capsys): @@ -86,6 +94,7 @@ def test_execute(tmpdir, caplog, capsys): assert nb.cells[0].outputs[0]["data"] == {"text/plain": "3"} +@requires_user_kernel_python3 @requires_nbconvert def test_execute_readme_ok(tmpdir): tmp_md = str(tmpdir.join("notebook.md")) @@ -104,6 +113,7 @@ def test_execute_readme_ok(tmpdir): jupytext(args=[tmp_md, "--execute"]) +@requires_user_kernel_python3 @requires_nbconvert @skip_on_windows def test_execute_readme_not_ok(tmpdir): @@ -128,6 +138,7 @@ def test_execute_readme_not_ok(tmpdir): jupytext(args=[tmp_md, "--execute"]) +@requires_user_kernel_python3 @requires_nbconvert @skip_on_windows def test_execute_sync(tmpdir, caplog, capsys): @@ -169,6 +180,7 @@ def test_execute_r(tmpdir, caplog, capsys): # pragma: no cover assert nb.cells[0].outputs[0]["data"]["text/markdown"] == "6" +@requires_user_kernel_python3 @requires_nbconvert @skip_on_windows def test_execute_in_subfolder(tmpdir, caplog, capsys):