Merge "Enable and fix Sphinx tests"

This commit is contained in:
Jenkins 2013-10-11 15:50:16 +00:00 committed by Gerrit Code Review
commit 3b52161a60
3 changed files with 305 additions and 521 deletions

View File

@ -1,12 +1,18 @@
# content of: tox.ini , put in same dir as setup.py
[tox]
envlist = py26,py26-nolxml,py27,py27-nolxml,py32,py32-nolxml,pypy,sphinxext,tg11,tg15,flask,cornice,coverage,py33,py33-nolxml,pecan-dev26,pecan-dev27,pecan-dev32,pecan-dev33,pep8
envlist = py26,py26-nolxml,py27,py27-nolxml,py32,py32-nolxml,pypy,tg11,tg15,flask,cornice,coverage,py33,py33-nolxml,pecan-dev26,pecan-dev27,pecan-dev32,pecan-dev33,pep8
[common]
testtools=
nose
coverage
pbr
webtest
basedeps=
transaction
pecan
Sphinx
[axes]
python=py26,py27,py32,py33,pypy
@ -17,24 +23,20 @@ json=json*,simplejson
[axis:python]
deps =
{[common]testtools}
webtest
transaction
{[common]basedeps}
suds
pecan
commands=
{envbindir}/coverage run {envbindir}/nosetests --nologcapture --with-xunit --xunit-file nosetests-{envname}.xml wsme/tests wsmeext/tests tests/pecantest --verbose {posargs}
{envbindir}/coverage run {envbindir}/nosetests --nologcapture --with-xunit --xunit-file nosetests-{envname}.xml wsme/tests wsmeext/tests tests/pecantest tests/test_sphinxext.py --verbose {posargs}
{envbindir}/coverage xml -o coverage-{envname}.xml wsme/*.py wsme/rest/*.py wsmeext/*.py
{envbindir}/coverage report --show-missing wsme/*.py wsme/rest/*.py wsmeext/*.py
[axis:python:py26]
deps =
{[common]testtools}
webtest
transaction
suds
pecan
unittest2
{[common]basedeps}
suds
basepython=python2.6
[axis:python:py27]
@ -45,30 +47,26 @@ basepython=python3.2
deps =
{[common]testtools}
webtest
transaction
pecan
{[common]basedeps}
https://bitbucket.org/bernh/suds-python-3-patches/downloads/suds_patched.zip
commands=
{envbindir}/coverage run {envbindir}/nosetests --with-xunit --xunit-file nosetests-{envname}.xml wsme/tests wsmeext/tests tests/pecantest tests/pecantest --verbose {posargs}
{envbindir}/coverage xml -o coverage-{envname}.xml --omit wsmeext/sphinxext.py wsme/*.py wsme/rest/*.py wsmeext/*.py
{envbindir}/coverage report --show-missing --omit wsmeext/sphinxext.py wsme/*.py wsme/rest/*.py wsmeext/*.py
{envbindir}/coverage run {envbindir}/nosetests --with-xunit --xunit-file nosetests-{envname}.xml wsme/tests wsmeext/tests tests/pecantest tests/pecantest tests/test_sphinxext.py --verbose {posargs}
{envbindir}/coverage xml -o coverage-{envname}.xml wsme/*.py wsme/rest/*.py wsmeext/*.py
{envbindir}/coverage report --show-missing wsme/*.py wsme/rest/*.py wsmeext/*.py
[axis:python:py33]
basepython=python3.3
deps =
{[common]testtools}
webtest
transaction
pecan
{[common]basedeps}
https://bitbucket.org/bernh/suds-python-3-patches/downloads/suds_patched.zip
commands=
{envbindir}/coverage run {envbindir}/nosetests --with-xunit --xunit-file nosetests-{envname}.xml wsme/tests wsmeext/tests tests/pecantest --verbose {posargs}
{envbindir}/coverage xml -o coverage-{envname}.xml --omit wsmeext/sphinxext.py wsme/*.py wsme/rest/*.py wsmeext/*.py
{envbindir}/coverage report --show-missing --omit wsmeext/sphinxext.py wsme/*.py wsme/rest/*.py wsmeext/*.py
{envbindir}/coverage run {envbindir}/nosetests --with-xunit --xunit-file nosetests-{envname}.xml wsme/tests wsmeext/tests tests/pecantest tests/test_sphinxext.py --verbose {posargs}
{envbindir}/coverage xml -o coverage-{envname}.xml wsme/*.py wsme/rest/*.py wsmeext/*.py
{envbindir}/coverage report --show-missing wsme/*.py wsme/rest/*.py wsmeext/*.py
[axis:sqlalchemy:sa5]
deps=
@ -101,20 +99,6 @@ deps=
setenv=
COVERAGE_FILE=.coverage.{envname}
[testenv:sphinxext]
basepython=python2.6
deps=
pbr
nose
coverage
simplejson
Jinja2<=2.6.99
Sphinx
commands=
{envbindir}/coverage run {envbindir}/nosetests --with-xunit --xunit-file nosetests-{envname}.xml tests/test_sphinxext.py --verbose {posargs}
{envbindir}/coverage xml -o coverage-{envname}.xml wsme/*.py wsme/rest/*.py wsmeext/*.py
{envbindir}/coverage report --show-missing wsme/*.py wsme/rest/*.py wsmeext/*.py
[testenv:tg11]
basepython=python2.6
deps=

761
tox.ini

File diff suppressed because it is too large Load Diff

View File

@ -2,6 +2,8 @@ import inspect
import re
import sys
import six
from sphinx import addnodes
from sphinx.ext import autodoc
from sphinx.domains.python import PyClasslike, PyClassmember
@ -37,7 +39,7 @@ def datatypename(datatype):
def make_sample_object(datatype):
if datatype is wsme.types.bytes:
return 'samplestring'
return six.b('samplestring')
if datatype is wsme.types.text:
return u'sample unicode'
if datatype is int:
@ -223,8 +225,6 @@ class TypeDocumenter(autodoc.ClassDocumenter):
# Check where to include the samples
samples_slot = self.options.samples_slot or self.default_samples_slot
print 'SAMPLES SLOT:', self.options.samples_slot
def add_docstring():
super(TypeDocumenter, self).add_content(
more_content, no_docstring)
@ -250,8 +250,9 @@ class TypeDocumenter(autodoc.ClassDocumenter):
u' .. code-block:: ' + language,
u'',
])
content.extend((
u' ' * 8 + line for line in sample.split('\n')))
content.extend(
u' ' * 8 + line
for line in six.text_type(sample).split('\n'))
for line in content:
self.add_line(line, u'<wsmeext.sphinxext')