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 # content of: tox.ini , put in same dir as setup.py
[tox] [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] [common]
testtools= testtools=
nose nose
coverage coverage
pbr pbr
webtest
basedeps=
transaction
pecan
Sphinx
[axes] [axes]
python=py26,py27,py32,py33,pypy python=py26,py27,py32,py33,pypy
@ -17,24 +23,20 @@ json=json*,simplejson
[axis:python] [axis:python]
deps = deps =
{[common]testtools} {[common]testtools}
webtest {[common]basedeps}
transaction
suds suds
pecan
commands= 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 xml -o coverage-{envname}.xml wsme/*.py wsme/rest/*.py wsmeext/*.py
{envbindir}/coverage report --show-missing wsme/*.py wsme/rest/*.py wsmeext/*.py {envbindir}/coverage report --show-missing wsme/*.py wsme/rest/*.py wsmeext/*.py
[axis:python:py26] [axis:python:py26]
deps = deps =
{[common]testtools} {[common]testtools}
webtest
transaction
suds
pecan
unittest2 unittest2
{[common]basedeps}
suds
basepython=python2.6 basepython=python2.6
[axis:python:py27] [axis:python:py27]
@ -45,30 +47,26 @@ basepython=python3.2
deps = deps =
{[common]testtools} {[common]testtools}
webtest {[common]basedeps}
transaction
pecan
https://bitbucket.org/bernh/suds-python-3-patches/downloads/suds_patched.zip https://bitbucket.org/bernh/suds-python-3-patches/downloads/suds_patched.zip
commands= 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 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 --omit wsmeext/sphinxext.py wsme/*.py wsme/rest/*.py wsmeext/*.py {envbindir}/coverage xml -o coverage-{envname}.xml 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 report --show-missing wsme/*.py wsme/rest/*.py wsmeext/*.py
[axis:python:py33] [axis:python:py33]
basepython=python3.3 basepython=python3.3
deps = deps =
{[common]testtools} {[common]testtools}
webtest {[common]basedeps}
transaction
pecan
https://bitbucket.org/bernh/suds-python-3-patches/downloads/suds_patched.zip https://bitbucket.org/bernh/suds-python-3-patches/downloads/suds_patched.zip
commands= commands=
{envbindir}/coverage run {envbindir}/nosetests --with-xunit --xunit-file nosetests-{envname}.xml wsme/tests wsmeext/tests tests/pecantest --verbose {posargs} {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 --omit wsmeext/sphinxext.py wsme/*.py wsme/rest/*.py wsmeext/*.py {envbindir}/coverage xml -o coverage-{envname}.xml 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 report --show-missing wsme/*.py wsme/rest/*.py wsmeext/*.py
[axis:sqlalchemy:sa5] [axis:sqlalchemy:sa5]
deps= deps=
@ -101,20 +99,6 @@ deps=
setenv= setenv=
COVERAGE_FILE=.coverage.{envname} 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] [testenv:tg11]
basepython=python2.6 basepython=python2.6
deps= 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 re
import sys import sys
import six
from sphinx import addnodes from sphinx import addnodes
from sphinx.ext import autodoc from sphinx.ext import autodoc
from sphinx.domains.python import PyClasslike, PyClassmember from sphinx.domains.python import PyClasslike, PyClassmember
@ -37,7 +39,7 @@ def datatypename(datatype):
def make_sample_object(datatype): def make_sample_object(datatype):
if datatype is wsme.types.bytes: if datatype is wsme.types.bytes:
return 'samplestring' return six.b('samplestring')
if datatype is wsme.types.text: if datatype is wsme.types.text:
return u'sample unicode' return u'sample unicode'
if datatype is int: if datatype is int:
@ -223,8 +225,6 @@ class TypeDocumenter(autodoc.ClassDocumenter):
# Check where to include the samples # Check where to include the samples
samples_slot = self.options.samples_slot or self.default_samples_slot samples_slot = self.options.samples_slot or self.default_samples_slot
print 'SAMPLES SLOT:', self.options.samples_slot
def add_docstring(): def add_docstring():
super(TypeDocumenter, self).add_content( super(TypeDocumenter, self).add_content(
more_content, no_docstring) more_content, no_docstring)
@ -250,8 +250,9 @@ class TypeDocumenter(autodoc.ClassDocumenter):
u' .. code-block:: ' + language, u' .. code-block:: ' + language,
u'', u'',
]) ])
content.extend(( content.extend(
u' ' * 8 + line for line in sample.split('\n'))) u' ' * 8 + line
for line in six.text_type(sample).split('\n'))
for line in content: for line in content:
self.add_line(line, u'<wsmeext.sphinxext') self.add_line(line, u'<wsmeext.sphinxext')