diff --git a/.travis.yml b/.travis.yml index 00e19168..1ee3e434 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,7 @@ env: - TEST_DIR=tests/examples - TEST_DIR=tests/em/fdem/inverse/adjoint - TEST_DIR=tests/em/fdem/forward + - TEST_DIR=tests/docs # Setup anaconda before_install: @@ -45,12 +46,6 @@ install: # Run test script: # test docs - - cd docs - - sphinx-build -nW -b html -d _build/doctrees . _build/html - - sphinx-build -nW -b latex -d _build/doctrees . _build/latex - - sphinx-build -nW -b linkcheck -d _build/doctrees . _build/linkcheck - - cd ../ - - nosetests $TEST_DIR --with-cov --cov SimPEG --cov-config .coveragerc -v -s diff --git a/tests/docs/test_docs.py b/tests/docs/test_docs.py new file mode 100644 index 00000000..cb060743 --- /dev/null +++ b/tests/docs/test_docs.py @@ -0,0 +1,21 @@ +import subprocess +import unittest +import os + + +class Doc_Test(unittest.TestCase): + + def test_html(self,rmdir=True): + check = subprocess.call(["sphinx-build", "-nW", "-b", "html", "-d", "../../docs/_build/doctrees", "../../docs", "../../docs/_build/html"]) + assert check == 0 + + def test_latex(self,rmdir=True): + check = subprocess.call(["sphinx-build", "-nW", "-b", "latex", "-d", "../../docs/_build/doctrees", "../../docs", "../../docs/_build/latex"]) + assert check == 0 + + def test_linkcheck(self,rmdir=True): + check = subprocess.call(["sphinx-build", "-nW", "-b", "linkcheck", "-d", "../../docs/_build/doctrees", "../../docs", "../../docs/_build"]) + assert check == 0 + +if __name__ == '__main__': + unittest.main() \ No newline at end of file