Update docs tests

This commit is contained in:
bendikro 2014-09-25 22:12:00 +01:00 committed by Calum Lind
parent 284b86ebb6
commit bb9702910b
3 changed files with 37 additions and 19 deletions

View File

@ -1,3 +1,8 @@
twisted twisted
pyopenssl pyopenssl
sphinxcontrib-napoleon sphinxcontrib-napoleon
mock
pyxdg
service_identity
PIL
mako

View File

@ -52,7 +52,7 @@ MOCK_MODULES = ['deluge.ui.languages', 'deluge.ui.countries', 'deluge.ui.gtkui.g
'libtorrent', 'psyco', 'rencode', 'libtorrent', 'psyco', 'rencode',
'twisted.web', 'twisted.web.client', 'twisted.web.error', 'twisted.web', 'twisted.web.client', 'twisted.web.error',
'win32file', 'win32event', 'win32gui', 'win32api', 'win32con', '_winreg', 'win32file', 'win32event', 'win32gui', 'win32api', 'win32con', '_winreg',
'pygtk', "gtk", "gobject", "gtk.gdk", "pango", "cairo", "pangocairo"] 'pygtk', "gtk", "gobject", "gtk.gdk", "pango", "cairo", "pangocairo", "chardet"]
for mod_name in MOCK_MODULES: for mod_name in MOCK_MODULES:
sys.modules[mod_name] = Mock() sys.modules[mod_name] = Mock()

49
tox.ini
View File

@ -107,25 +107,12 @@ deps =
commands= commands=
sh -c "flake8 --max-complexity 10 deluge || true" sh -c "flake8 --max-complexity 10 deluge || true"
[testenv:docscoverage] # We do not have all dependencies on RTD and travis so we exclude the
changedir=docs # site packages (sitepackages=False) when building docs so that local
install_command=pip install {opts} {packages} # tests have a similar environment.
deps =
{[testenv]deps}
sphinx
sphinxcontrib-napoleon
coverage
pytest-cov
whitelist_externals=
{[testenv]whitelist_externals}
mkdir
sphinx-build
commands=
mkdir -p build/doccoverage
sphinx-build -W -b coverage -d build/doctrees source build/doccoverage
py.test --doctest-glob='*.rst'
[testenv:docs] [docsbase]
sitepackages=False
changedir=docs changedir=docs
install_command=pip install {opts} --allow-external PIL --allow-unverified PIL {packages} install_command=pip install {opts} --allow-external PIL --allow-unverified PIL {packages}
whitelist_externals= whitelist_externals=
@ -135,6 +122,32 @@ deps =
{[testenv]deps} {[testenv]deps}
sphinx sphinx
sphinxcontrib-napoleon sphinxcontrib-napoleon
mock
PIL PIL
commands= commands=
sphinx-build -E -W -b html -d build/doctrees source build/html sphinx-build -E -W -b html -d build/doctrees source build/html
[testenv:docs]
sitepackages={[docsbase]sitepackages}
changedir={[docsbase]changedir}
install_command={[docsbase]install_command}
whitelist_externals={[docsbase]whitelist_externals}
deps={[docsbase]deps}
commands=
sphinx-build -v -E -T -b html -d build/doctrees source build/html
[testenv:docscoverage]
sitepackages={[docsbase]sitepackages}
changedir={[docsbase]changedir}
install_command={[docsbase]install_command}
whitelist_externals=
{[docsbase]whitelist_externals}
mkdir
deps=
{[docsbase]deps}
coverage
pytest-cov
commands=
mkdir -p build/doccoverage
sphinx-build -W -b coverage -d build/doctrees source build/doccoverage
py.test --doctest-glob='*.rst'