def test_with_template(doc_worktree):
    foo_sphinx = doc_worktree.create_sphinx_project("foo")
    doc_worktree.add_templates()
    # pylint: disable-msg=E1101
    foo_path = py.path.local(foo_sphinx.path)
    conf_py = foo_path.join("source", "conf.in.py").ensure(file=True)
    settings = """\
# My custom settings

project = "foo"
"""
    conf_py.write(settings)
    foo_sphinx.configure(version="1.2.3")
    conf_py = foo_path.join("build-doc", "conf.py").read()
    conf_dict = dict()
    assert "# My custom settings" in conf_py
    exec(conf_py, conf_dict)
    assert conf_dict["version"] == "1.2.3"
    expected = doc_worktree.template_project.themes_path
    assert conf_dict["html_theme_path"] == [expected]
dataset/ETHPy150Open aldebaran/qibuild/python/qidoc/test/test_sphinx.py/test_with_template/original