1 1
import os
2 1
import sys
3 1
import pytest
4

5 1
from ipypublish.convert.config_manager import iter_all_export_paths
6

7

8 1
@pytest.mark.parametrize("plugin_name,plugin_path", list(iter_all_export_paths()))
9 1
@pytest.mark.ipynb("basic_nb")
10 1
def test_basic_all_plugins(ipynb_app, plugin_name, plugin_path):
11

12 1
    if (
13
        plugin_name in ["sphinx_ipypublish_all.ext"] or "exec" in plugin_name
14
    ) and sys.version_info[0] < 3:
15
        # TODO this fails because the kernel is set as python3 in the notebook
16
        # could add a replacement variable e.g. ${pykernel}
17
        # and allow parsing of it to main.publish (default = "")
18 0
        return
19

20 1
    ipynb_app.run({"conversion": plugin_name})
21

22
    # no output file to compare
23 1
    if plugin_name in [
24
        "python_with_meta_stream",
25
        "sphinx_ipypublish_all.ext",
26
        "sphinx_ipypublish_all.ext.noexec",
27
    ]:
28 1
        return
29

30
    # test build exists only
31 1
    if plugin_name in ["sphinx_ipypublish_all.run", "sphinx_ipypublish_main.run"]:
32 1
        outpath = ipynb_app.converted_path.joinpath(
33
            "build", "html", os.path.splitext(ipynb_app.input_file.name)[0] + ".html"
34
        )
35 1
        assert outpath.exists()
36 1
        return
37

38 1
    ipynb_app.assert_converted_exists()
39 1
    ipynb_app.assert_converted_equals_expected(plugin_name)

Read our documentation on viewing source code .

Loading