Skip to content

Commit

Permalink
These tests require a python kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
mwouts committed Feb 9, 2022
1 parent 1fa1451 commit 60382fc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
6 changes: 6 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand All @@ -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"))
Expand All @@ -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"))
Expand Down Expand Up @@ -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
Expand All @@ -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):
Expand Down Expand Up @@ -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(
Expand Down
14 changes: 13 additions & 1 deletion tests/test_execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand All @@ -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"))
Expand All @@ -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):
Expand All @@ -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):
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 60382fc

Please sign in to comment.