From 923de7e5597d59ce601a38ac262fb5004330c90a Mon Sep 17 00:00:00 2001 From: Marc Wouts Date: Wed, 9 Feb 2022 17:33:25 +0100 Subject: [PATCH] Fix test requirements (#919) * Require pandoc==2.16.2 for testing * Regenerate the pandoc versions of the sample notebooks the representation for code cells has changed from ` ``` {.python}` to ` ``` python` * Some tests require a python kernel --- docs/CHANGELOG.md | 1 + environment-ci.yml | 2 +- environment.yml | 2 +- jupytext/pandoc.py | 16 ++++++++++---- .../ipynb_to_pandoc/Notebook_with_R_magic.md | 8 +++---- .../Notebook_with_more_R_magic_111.md | 4 ++-- .../ipynb_to_pandoc/World population.md | 22 +++++++++---------- .../mirror/ipynb_to_pandoc/cat_variable.md | 2 +- .../convert_to_py_then_test_with_update83.md | 4 ++-- .../mirror/ipynb_to_pandoc/frozen_cell.md | 4 ++-- .../mirror/ipynb_to_pandoc/ir_notebook.md | 6 ++--- .../julia_benchmark_plotly_barchart.md | 6 ++--- .../mirror/ipynb_to_pandoc/jupyter.md | 6 ++--- .../mirror/ipynb_to_pandoc/jupyter_again.md | 6 ++--- .../jupyter_with_raw_cell_in_body.md | 2 +- .../jupyter_with_raw_cell_on_top.md | 4 ++-- .../notebook_with_complex_metadata.md | 2 +- .../ipynb_to_pandoc/nteract_with_parameter.md | 8 +++---- .../mirror/ipynb_to_pandoc/plotly_graphs.md | 4 ++-- .../sample_rise_notebook_66.md | 2 +- .../text_outputs_and_images.md | 14 ++++++------ tests/test_black.py | 1 + tests/test_cli.py | 6 +++++ tests/test_execute.py | 14 +++++++++++- tests/utils.py | 4 +++- 25 files changed, 90 insertions(+), 60 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 75bff0c90..ca55de719 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -13,6 +13,7 @@ Jupytext ChangeLog **Changed** - We have updated the pre-commit hooks and in particular we switched to the first stable version of `black==22.1.0`. +- We require `pandoc==2.16.2` for testing. The representation for code cells changed from ` ``` {.python}` to ` ``` python` in that version of Pandoc ([#906](https://github.com/mwouts/jupytext/issues/906)). We don't use `pandoc>=2.17` in tests at the moment because of the introduction of cell ids that cannot be filtered. 1.13.6 (2022-01-11) diff --git a/environment-ci.yml b/environment-ci.yml index 473dc204e..233fed5b5 100644 --- a/environment-ci.yml +++ b/environment-ci.yml @@ -22,7 +22,7 @@ dependencies: - autopep8 - black - isort>=5.3.0 - - pandoc>=2.11.4 + - pandoc==2.16.2 - sphinx-gallery<0.8 - pre-commit - gitpython diff --git a/environment.yml b/environment.yml index d07a0e15f..56e8e85fd 100644 --- a/environment.yml +++ b/environment.yml @@ -29,7 +29,7 @@ dependencies: - pip - setuptools - twine - - pandoc>=2.11.4 + - pandoc==2.16.2 # make html in docs folder - sphinx - tox-conda diff --git a/jupytext/pandoc.py b/jupytext/pandoc.py index 305b94436..310a2f3ea 100644 --- a/jupytext/pandoc.py +++ b/jupytext/pandoc.py @@ -35,16 +35,18 @@ def pandoc(args, filein=None, fileout=None): return out.decode("utf-8") -def is_pandoc_available(min_version="2.7.2"): +def is_pandoc_available(min_version="2.7.2", max_version=None): """Is Pandoc>=2.7.2 available?""" try: - raise_if_pandoc_is_not_available(min_version=min_version) + raise_if_pandoc_is_not_available( + min_version=min_version, max_version=max_version + ) return True except PandocError: return False -def raise_if_pandoc_is_not_available(min_version="2.7.2"): +def raise_if_pandoc_is_not_available(min_version="2.7.2", max_version=None): """Raise with an informative error message if pandoc is not available""" try: from pkg_resources import parse_version @@ -61,7 +63,13 @@ def raise_if_pandoc_is_not_available(min_version="2.7.2"): if parse_version(version) < parse_version(min_version): raise PandocError( f"The Pandoc Markdown format requires 'pandoc>={min_version}', " - f"but pandoc version {version} was not found" + f"but pandoc version {version} was found" + ) + + if max_version and parse_version(version) > parse_version(max_version): + raise PandocError( + f"The Pandoc Markdown format requires 'pandoc<={max_version}', " + f"but pandoc version {version} was found" ) return version diff --git a/tests/notebooks/mirror/ipynb_to_pandoc/Notebook_with_R_magic.md b/tests/notebooks/mirror/ipynb_to_pandoc/Notebook_with_R_magic.md index 36b4d4011..0d90a5863 100644 --- a/tests/notebooks/mirror/ipynb_to_pandoc/Notebook_with_R_magic.md +++ b/tests/notebooks/mirror/ipynb_to_pandoc/Notebook_with_R_magic.md @@ -15,20 +15,20 @@ This notebook shows the use of R cells to generate plots ::: ::: {.cell .code} -``` {.python} +``` python %load_ext rpy2.ipython ``` ::: ::: {.cell .code} -``` {.python} +``` python %%R suppressMessages(require(tidyverse)) ``` ::: ::: {.cell .code} -``` {.python} +``` python %%R ggplot(iris, aes(x = Sepal.Length, y = Petal.Length, color=Species)) + geom_point() ``` @@ -39,7 +39,7 @@ The default plot dimensions are not good for us, so we use the -w and -h paramet ::: ::: {.cell .code} -``` {.python} +``` python %%R -w 400 -h 240 ggplot(iris, aes(x = Sepal.Length, y = Petal.Length, color=Species)) + geom_point() ``` diff --git a/tests/notebooks/mirror/ipynb_to_pandoc/Notebook_with_more_R_magic_111.md b/tests/notebooks/mirror/ipynb_to_pandoc/Notebook_with_more_R_magic_111.md index 9a001796b..d6ae7f7a4 100644 --- a/tests/notebooks/mirror/ipynb_to_pandoc/Notebook_with_more_R_magic_111.md +++ b/tests/notebooks/mirror/ipynb_to_pandoc/Notebook_with_more_R_magic_111.md @@ -9,7 +9,7 @@ jupyter: --- ::: {.cell .code} -``` {.python} +``` python %load_ext rpy2.ipython import pandas as pd @@ -25,7 +25,7 @@ df = pd.DataFrame( ::: ::: {.cell .code} -``` {.python} +``` python %%R -i df library("ggplot2") ggplot(data = df) + geom_point(aes(x = X, y = Y, color = Letter, size = Z)) diff --git a/tests/notebooks/mirror/ipynb_to_pandoc/World population.md b/tests/notebooks/mirror/ipynb_to_pandoc/World population.md index 42ef06740..29e7c590a 100644 --- a/tests/notebooks/mirror/ipynb_to_pandoc/World population.md +++ b/tests/notebooks/mirror/ipynb_to_pandoc/World population.md @@ -19,7 +19,7 @@ using the [wbdata](https://github.com/OliverSherouse/wbdata) python package ::: ::: {.cell .code} -``` {.python} +``` python import pandas as pd import wbdata as wb @@ -34,7 +34,7 @@ the World Bank site. ::: ::: {.cell .code} -``` {.python} +``` python wb.search_indicators('Population, total') # SP.POP.TOTL # wb.search_indicators('area') # => https://data.worldbank.org/indicator is easier to use @@ -46,7 +46,7 @@ Now we download the population data ::: ::: {.cell .code} -``` {.python} +``` python indicators = {'SP.POP.TOTL': 'Population, total', 'AG.SRF.TOTL.K2': 'Surface area (sq. km)', 'AG.LND.TOTL.K2': 'Land area (sq. km)', @@ -61,7 +61,7 @@ World is one of the countries ::: ::: {.cell .code} -``` {.python} +``` python data.loc['World'] ``` ::: @@ -71,7 +71,7 @@ Can we classify over continents? ::: ::: {.cell .code} -``` {.python} +``` python data.loc[(slice(None), '2017-01-01'), :]['Population, total'].dropna( ).sort_values().tail(60).index.get_level_values('country') ``` @@ -82,7 +82,7 @@ Extract zones manually (in order of increasing population) ::: ::: {.cell .code} -``` {.python} +``` python zones = ['North America', 'Middle East & North Africa', 'Latin America & Caribbean', 'Europe & Central Asia', 'Sub-Saharan Africa', 'South Asia', @@ -95,7 +95,7 @@ And extract population information (and check total is right) ::: ::: {.cell .code} -``` {.python} +``` python population = data.loc[zones]['Population, total'].swaplevel().unstack() population = population[zones] assert all(data.loc['World']['Population, total'] == population.sum(axis=1)) @@ -107,13 +107,13 @@ assert all(data.loc['World']['Population, total'] == population.sum(axis=1)) ::: ::: {.cell .code} -``` {.python} +``` python import matplotlib.pyplot as plt ``` ::: ::: {.cell .code} -``` {.python} +``` python plt.clf() plt.figure(figsize=(10, 5), dpi=100) plt.stackplot(population.index, population.values.T / 1e9) @@ -135,7 +135,7 @@ now we just do a stacked bar plot. ::: ::: {.cell .code} -``` {.python} +``` python import plotly.offline as offline import plotly.graph_objs as go @@ -144,7 +144,7 @@ offline.init_notebook_mode() ::: ::: {.cell .code} -``` {.python} +``` python bars = [go.Bar(x=population.index, y=population[zone], name=zone) for zone in zones] fig = go.Figure(data=bars, diff --git a/tests/notebooks/mirror/ipynb_to_pandoc/cat_variable.md b/tests/notebooks/mirror/ipynb_to_pandoc/cat_variable.md index 2e39978c3..659bec56a 100644 --- a/tests/notebooks/mirror/ipynb_to_pandoc/cat_variable.md +++ b/tests/notebooks/mirror/ipynb_to_pandoc/cat_variable.md @@ -9,7 +9,7 @@ jupyter: --- ::: {.cell .code} -``` {.python} +``` python cat = 42 ``` ::: diff --git a/tests/notebooks/mirror/ipynb_to_pandoc/convert_to_py_then_test_with_update83.md b/tests/notebooks/mirror/ipynb_to_pandoc/convert_to_py_then_test_with_update83.md index 005e511ce..57612c4a2 100644 --- a/tests/notebooks/mirror/ipynb_to_pandoc/convert_to_py_then_test_with_update83.md +++ b/tests/notebooks/mirror/ipynb_to_pandoc/convert_to_py_then_test_with_update83.md @@ -9,7 +9,7 @@ jupyter: --- ::: {.cell .code} -``` {.python} +``` python %%time print('asdf') @@ -21,6 +21,6 @@ Thanks for jupytext! ::: ::: {.cell .code} -``` {.python} +``` python ``` ::: diff --git a/tests/notebooks/mirror/ipynb_to_pandoc/frozen_cell.md b/tests/notebooks/mirror/ipynb_to_pandoc/frozen_cell.md index fe6e55423..c5fd9796f 100644 --- a/tests/notebooks/mirror/ipynb_to_pandoc/frozen_cell.md +++ b/tests/notebooks/mirror/ipynb_to_pandoc/frozen_cell.md @@ -9,14 +9,14 @@ jupyter: --- ::: {.cell .code} -``` {.python} +``` python # This is an unfrozen cell. Works as usual. print("I'm a regular cell so I run and print!") ``` ::: ::: {.cell .code deletable="false" editable="false" run_control="{\"frozen\":true}"} -``` {.python} +``` python # This is an frozen cell print("I'm frozen so Im not executed :(") ``` diff --git a/tests/notebooks/mirror/ipynb_to_pandoc/ir_notebook.md b/tests/notebooks/mirror/ipynb_to_pandoc/ir_notebook.md index 4d75194e8..c4b6b8bc5 100644 --- a/tests/notebooks/mirror/ipynb_to_pandoc/ir_notebook.md +++ b/tests/notebooks/mirror/ipynb_to_pandoc/ir_notebook.md @@ -13,18 +13,18 @@ This is a jupyter notebook that uses the IR kernel. ::: ::: {.cell .code} -``` {.R} +``` R sum(1:10) ``` ::: ::: {.cell .code} -``` {.R} +``` R plot(cars) ``` ::: ::: {.cell .code} -``` {.R} +``` R ``` ::: diff --git a/tests/notebooks/mirror/ipynb_to_pandoc/julia_benchmark_plotly_barchart.md b/tests/notebooks/mirror/ipynb_to_pandoc/julia_benchmark_plotly_barchart.md index e1d221860..e62c607ca 100644 --- a/tests/notebooks/mirror/ipynb_to_pandoc/julia_benchmark_plotly_barchart.md +++ b/tests/notebooks/mirror/ipynb_to_pandoc/julia_benchmark_plotly_barchart.md @@ -9,7 +9,7 @@ jupyter: --- ::: {.cell .code} -``` {.julia} +``` julia # IJulia rocks! So does Plotly. Check it out using Plotly @@ -21,7 +21,7 @@ Plotly.signin(username, api_key) ::: ::: {.cell .code} -``` {.julia} +``` julia # Following data taken from http://julialang.org/ frontpage benchmarks = ["fib", "parse_int", "quicksort3", "mandel", "pi_sum", "rand_mat_stat", "rand_mat_mul"] platforms = ["Fortran", "Julia", "Python", "R", "Matlab", "Mathematica", "Javascript", "Go"] @@ -70,7 +70,7 @@ display("text/html", s) ::: ::: {.cell .code} -``` {.julia} +``` julia # checkout https://plot.ly/api/ for more Julia examples! # But to show off some other Plotly features: x = 1:1500 diff --git a/tests/notebooks/mirror/ipynb_to_pandoc/jupyter.md b/tests/notebooks/mirror/ipynb_to_pandoc/jupyter.md index 1b0e91158..5564be9f2 100644 --- a/tests/notebooks/mirror/ipynb_to_pandoc/jupyter.md +++ b/tests/notebooks/mirror/ipynb_to_pandoc/jupyter.md @@ -15,7 +15,7 @@ This notebook is a simple jupyter notebook. It only has markdown and code cells. ::: ::: {.cell .code} -``` {.python} +``` python a = 1 b = 2 a + b @@ -27,13 +27,13 @@ Now we return a few tuples ::: ::: {.cell .code} -``` {.python} +``` python a, b ``` ::: ::: {.cell .code} -``` {.python} +``` python a, b, a+b ``` ::: diff --git a/tests/notebooks/mirror/ipynb_to_pandoc/jupyter_again.md b/tests/notebooks/mirror/ipynb_to_pandoc/jupyter_again.md index 076bcf86c..2569427fa 100644 --- a/tests/notebooks/mirror/ipynb_to_pandoc/jupyter_again.md +++ b/tests/notebooks/mirror/ipynb_to_pandoc/jupyter_again.md @@ -9,7 +9,7 @@ jupyter: --- ::: {.cell .code} -``` {.python} +``` python c = ''' title: "Quick test" output: @@ -23,14 +23,14 @@ editor_options: ::: ::: {.cell .code} -``` {.python} +``` python import yaml print(yaml.dump(yaml.load(c))) ``` ::: ::: {.cell .code} -``` {.python} +``` python ?next ``` ::: diff --git a/tests/notebooks/mirror/ipynb_to_pandoc/jupyter_with_raw_cell_in_body.md b/tests/notebooks/mirror/ipynb_to_pandoc/jupyter_with_raw_cell_in_body.md index 7bbbe742b..838e15b9d 100644 --- a/tests/notebooks/mirror/ipynb_to_pandoc/jupyter_with_raw_cell_in_body.md +++ b/tests/notebooks/mirror/ipynb_to_pandoc/jupyter_with_raw_cell_in_body.md @@ -9,7 +9,7 @@ jupyter: --- ::: {.cell .code} -``` {.python} +``` python 1+2+3 ``` ::: diff --git a/tests/notebooks/mirror/ipynb_to_pandoc/jupyter_with_raw_cell_on_top.md b/tests/notebooks/mirror/ipynb_to_pandoc/jupyter_with_raw_cell_on_top.md index 7a1d1bc3f..e33e0c0da 100644 --- a/tests/notebooks/mirror/ipynb_to_pandoc/jupyter_with_raw_cell_on_top.md +++ b/tests/notebooks/mirror/ipynb_to_pandoc/jupyter_with_raw_cell_on_top.md @@ -23,12 +23,12 @@ editor_options: ::: ::: {.cell .code} -``` {.python} +``` python 1+2+3 ``` ::: ::: {.cell .code} -``` {.python} +``` python ``` ::: diff --git a/tests/notebooks/mirror/ipynb_to_pandoc/notebook_with_complex_metadata.md b/tests/notebooks/mirror/ipynb_to_pandoc/notebook_with_complex_metadata.md index a0dc83a3c..ea8f36039 100644 --- a/tests/notebooks/mirror/ipynb_to_pandoc/notebook_with_complex_metadata.md +++ b/tests/notebooks/mirror/ipynb_to_pandoc/notebook_with_complex_metadata.md @@ -9,6 +9,6 @@ jupyter: --- ::: {.cell .code} -``` {.python} +``` python ``` ::: diff --git a/tests/notebooks/mirror/ipynb_to_pandoc/nteract_with_parameter.md b/tests/notebooks/mirror/ipynb_to_pandoc/nteract_with_parameter.md index a1737f2a9..fed8a8f44 100644 --- a/tests/notebooks/mirror/ipynb_to_pandoc/nteract_with_parameter.md +++ b/tests/notebooks/mirror/ipynb_to_pandoc/nteract_with_parameter.md @@ -11,19 +11,19 @@ jupyter: --- ::: {.cell .code inputHidden="false" outputHidden="false" tags="[\"parameters\"]"} -``` {.python} +``` python param = 4 ``` ::: ::: {.cell .code inputHidden="false" outputHidden="false"} -``` {.python} +``` python import pandas as pd ``` ::: ::: {.cell .code inputHidden="false" outputHidden="false"} -``` {.python} +``` python df = pd.DataFrame({'A': [1, 2], 'B': [3 + param, 4]}, index=pd.Index(['x0', 'x1'], name='x')) df @@ -31,7 +31,7 @@ df ::: ::: {.cell .code inputHidden="false" outputHidden="false"} -``` {.python} +``` python %matplotlib inline df.plot(kind='bar') ``` diff --git a/tests/notebooks/mirror/ipynb_to_pandoc/plotly_graphs.md b/tests/notebooks/mirror/ipynb_to_pandoc/plotly_graphs.md index 7798ed2a3..736b0c362 100644 --- a/tests/notebooks/mirror/ipynb_to_pandoc/plotly_graphs.md +++ b/tests/notebooks/mirror/ipynb_to_pandoc/plotly_graphs.md @@ -21,14 +21,14 @@ We use Plotly\'s connected mode to make the notebook lighter - when connected, t ::: ::: {.cell .code} -``` {.python} +``` python import plotly.offline as offline offline.init_notebook_mode(connected=True) ``` ::: ::: {.cell .code} -``` {.python} +``` python import plotly.graph_objects as go fig = go.Figure( data=[go.Bar(y=[2, 3, 1])], diff --git a/tests/notebooks/mirror/ipynb_to_pandoc/sample_rise_notebook_66.md b/tests/notebooks/mirror/ipynb_to_pandoc/sample_rise_notebook_66.md index f72a4bf21..6fe251eea 100644 --- a/tests/notebooks/mirror/ipynb_to_pandoc/sample_rise_notebook_66.md +++ b/tests/notebooks/mirror/ipynb_to_pandoc/sample_rise_notebook_66.md @@ -13,7 +13,7 @@ A markdown cell ::: ::: {.cell .code slideshow="{\"slide_type\":\"\"}"} -``` {.python} +``` python 1+1 ``` ::: diff --git a/tests/notebooks/mirror/ipynb_to_pandoc/text_outputs_and_images.md b/tests/notebooks/mirror/ipynb_to_pandoc/text_outputs_and_images.md index fa0d4a87a..58c707fa7 100644 --- a/tests/notebooks/mirror/ipynb_to_pandoc/text_outputs_and_images.md +++ b/tests/notebooks/mirror/ipynb_to_pandoc/text_outputs_and_images.md @@ -19,7 +19,7 @@ Using `print`, `sys.stdout` and `sys.stderr` ::: ::: {.cell .code} -``` {.python} +``` python import sys print('using print') sys.stdout.write('using sys.stdout.write') @@ -28,7 +28,7 @@ sys.stderr.write('using sys.stderr.write') ::: ::: {.cell .code} -``` {.python} +``` python import logging logging.debug('Debug') logging.info('Info') @@ -44,14 +44,14 @@ Using `pandas`. Here we find two representations: both text and HTML. ::: ::: {.cell .code} -``` {.python} +``` python import pandas as pd pd.DataFrame([4]) ``` ::: ::: {.cell .code} -``` {.python} +``` python from IPython.display import display display(pd.DataFrame([5])) display(pd.DataFrame([6])) @@ -63,13 +63,13 @@ display(pd.DataFrame([6])) ::: ::: {.cell .code} -``` {.python} +``` python %matplotlib inline ``` ::: ::: {.cell .code} -``` {.python} +``` python # First plot from matplotlib import pyplot as plt import numpy as np @@ -95,7 +95,7 @@ plt.show() ::: ::: {.cell .code} -``` {.python} +``` python undefined_variable ``` ::: diff --git a/tests/test_black.py b/tests/test_black.py index f562af3f4..396e737b8 100644 --- a/tests/test_black.py +++ b/tests/test_black.py @@ -89,6 +89,7 @@ def test_pipe_into_flake8(): @requires_black +@requires_flake8 @pytest.mark.parametrize("nb_file", list_notebooks("ipynb_py")[:1]) def test_apply_black_through_jupytext(tmpdir, nb_file): # Load real notebook metadata to get the 'auto' extension in --pipe-fmt to work diff --git a/tests/test_cli.py b/tests/test_cli.py index 376a83556..1d1598068 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 bc4ed3e68..cd64ad45d 100644 --- a/tests/test_execute.py +++ b/tests/test_execute.py @@ -7,9 +7,15 @@ from jupytext.cli import jupytext from jupytext.version import __version__ -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): @@ -39,6 +45,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): @@ -69,6 +76,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): @@ -88,6 +96,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")) @@ -106,6 +115,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): @@ -130,6 +140,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): @@ -171,6 +182,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): diff --git a/tests/utils.py b/tests/utils.py index 7e94be686..964c9d4fd 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -55,7 +55,9 @@ def isort_version(): requires_pandoc = pytest.mark.skipif( # The mirror files changed slightly when Pandoc 2.11 was introduced # https://github.com/mwouts/jupytext/commit/c07d919702999056ce47f92b74f63a15c8361c5d - not is_pandoc_available(min_version="2.11"), + # The mirror files changed again when Pandoc 2.16 was introduced + # https://github.com/mwouts/jupytext/pull/919/commits/1fa1451ecdaa6ad8d803bcb6fb0c0cf09e5371bf + not is_pandoc_available(min_version="2.16.2", max_version="2.16.2"), reason="pandoc>=2.11 is not available", ) requires_quarto = pytest.mark.skipif(