def test_pypandoc_config_keys(sphinx_app_wrapper):
    """Tests 'pypandoc' dictonary key checking."""
    from sphinx_gallery.gen_gallery import parse_config
    with pytest.raises(ConfigError,
                       match="'pypandoc' only accepts the following key "
                       "values:"):
        parse_config(sphinx_app_wrapper.create_sphinx_app())
def test_pypandoc_config_list(sphinx_app_wrapper):
    """Tests 'pypandoc' type checking."""
    from sphinx_gallery.gen_gallery import parse_config
    with pytest.raises(ConfigError,
                       match="'pypandoc' parameter must be of type bool or "
                       "dict"):
        parse_config(sphinx_app_wrapper.create_sphinx_app())
def test_backreferences_dir_config(sphinx_app_wrapper):
    """Tests 'backreferences_dir' type checking."""
    from sphinx_gallery.gen_gallery import parse_config
    with pytest.raises(ValueError,
                       match="The 'backreferences_dir' parameter must be of"):
        parse_config(sphinx_app_wrapper.create_sphinx_app())
def test_first_notebook_cell_config(sphinx_app_wrapper):
    from sphinx_gallery.gen_gallery import parse_config
    # First cell must be str
    with pytest.raises(ValueError):
        parse_config(sphinx_app_wrapper.create_sphinx_app())
Exemple #5
0
def test_backreferences_dir_pathlib_config(sphinx_app_wrapper):
    """Tests pathlib.Path does not raise exception."""
    from sphinx_gallery.gen_gallery import parse_config
    parse_config(sphinx_app_wrapper.create_sphinx_app())
def test_first_notebook_cell_config(sphinx_app_wrapper):
    from sphinx_gallery.gen_gallery import parse_config
    # First cell must be str
    with pytest.raises(ValueError):
        parse_config(sphinx_app_wrapper.create_sphinx_app())