Skip to content

Commit 28baf72

Browse files
committed
Add test for sphinx doc build fix #479
1 parent c184dc6 commit 28baf72

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

tests/test_docs.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# coding=utf-8
2+
"""
3+
Test the build of the sphinx documentation
4+
5+
Released under MIT license, see LICENSE file
6+
"""
7+
import os
8+
9+
import pytest
10+
11+
from sphinx.application import Sphinx
12+
13+
DOCS_SRCDIR = 'docs'
14+
DOCS_BUILDDIR = os.path.join('docs', '_build')
15+
DOCS_TREEDIR = os.path.join(DOCS_BUILDDIR, 'doctrees')
16+
17+
def test_html_documentation():
18+
# if you want really strict checking, set warningiserror=True
19+
docs = Sphinx(DOCS_SRCDIR,
20+
DOCS_SRCDIR,
21+
DOCS_BUILDDIR,
22+
DOCS_TREEDIR,
23+
buildername='html',
24+
warningiserror=False,
25+
)
26+
# this throws exceptions for errors, which pytest then
27+
# treats as a failure
28+
docs.build(force_all=True)

0 commit comments

Comments
 (0)