Repository: executablebooks/jupyter-book
File: tests/test_sphinx_multitoc_numbering.py (Python)

Code before:
# from jupyter_book.cli import main as commands


@pytest.mark.parametrize(
    "toc_file",
    (
        "_toc_numbered.yml",  # Numbered at top-level
        "_toc_numbered_depth.yml",  # Numbered at top-level, limited to depth 1
        "_toc_numbered_parts.yml",  # Numbered at top-level w/ parts
        "_toc_numbered_parts_subset.yml",  # Only some sections numbered
        "_toc_numbered_depth_parts_subset.yml",  # Selected numbering limited to depth 1
    ),
)
def test_toc_numbered_multitoc_numbering_false(
    toc_file, cli, build_resources, file_regression
):
    """Testing use_multitoc_numbering: false"""
    books, tocs = build_resources
    config = books.joinpath("config").joinpath("_config_sphinx_multitoc_numbering.yml")
    toc = tocs.joinpath(toc_file)
    # result = cli.invoke(
    #     commands.build,
    #     [
    #         tocs.as_posix(),
    #         "--path-output",
    #         books.as_posix(),
    #         "--toc",
    #         toc.as_posix(),
    #         "--config",
    #         config.as_posix(),
    #         "-W",
    #     ],
    # )
    # assert result.exit_code == 0, result.output

    # Issue #1339: There is an issue when using CliRunner and building projects
    # that make use of --config. The internal state of Sphinx appears to
    # be correct, but the written outputs (i.e. html) are not correct
    # suggesting some type of caching is going on.
    process = subprocess.Popen(
        [
            "jb",
            "build",
            tocs.as_posix(),
            "--path-output",
            books.as_posix(),
            "--toc",
            toc.as_posix(),
            "--config",
            config.as_posix(),
            "-W",

Review comment (suggestion):
```suggestion
    # TODO: commented out because of the issue described below. Uncomment when it is resolved.
    # result = cli.invoke(
```

Code after:
# from jupyter_book.cli import main as commands


@pytest.mark.parametrize(
    "toc_file",
    (
        "_toc_numbered.yml",  # Numbered at top-level
        "_toc_numbered_depth.yml",  # Numbered at top-level, limited to depth 1
        "_toc_numbered_parts.yml",  # Numbered at top-level w/ parts
        "_toc_numbered_parts_subset.yml",  # Only some sections numbered
        "_toc_numbered_depth_parts_subset.yml",  # Selected numbering limited to depth 1
    ),
)
def test_toc_numbered_multitoc_numbering_false(
    toc_file, cli, build_resources, file_regression
):
    """Testing use_multitoc_numbering: false"""
    books, tocs = build_resources
    config = books.joinpath("config").joinpath("_config_sphinx_multitoc_numbering.yml")
    toc = tocs.joinpath(toc_file)
    # TODO: commented out because of the issue described below. Uncomment when it is resolved.
    # Issue #1339: There is an issue when using CliRunner and building projects
    # that make use of --config. The internal state of Sphinx appears to
    # be correct, but the written outputs (i.e. html) are not correct
    # suggesting some type of caching is going on.
    # result = cli.invoke(
    #     commands.build,
    #     [
    #         tocs.as_posix(),
    #         "--path-output",
    #         books.as_posix(),
    #         "--toc",
    #         toc.as_posix(),
    #         "--config",
    #         config.as_posix(),
    #         "-W",
    #     ],
    # )
    # assert result.exit_code == 0, result.output
    process = subprocess.Popen(
        [
            "jb",
            "build",
            tocs.as_posix(),
            "--path-output",
            books.as_posix(),
            "--toc",
            toc.as_posix(),
            "--config",
            config.as_posix(),
            "-W",