Closes #1410: imports Mock from unittest.mock when available (Python >=3.3)

This commit is contained in:
Rob Ruana 2014-03-06 03:49:11 -05:00
parent 02363c3ce2
commit 5564012306
2 changed files with 21 additions and 2 deletions

View File

@ -10,7 +10,11 @@
:license: BSD, see LICENSE for details. :license: BSD, see LICENSE for details.
""" """
from mock import Mock try:
# Python >=3.3
from unittest.mock import Mock
except ImportError:
from mock import Mock
from sphinx.application import Sphinx from sphinx.application import Sphinx
from sphinx.ext.napoleon import (_process_docstring, _skip_member, Config, from sphinx.ext.napoleon import (_process_docstring, _skip_member, Config,
setup) setup)

17
tox.ini
View File

@ -3,7 +3,6 @@ envlist=py26,py27,py32,py33,pypy,du11,du10
[testenv] [testenv]
deps= deps=
mock
nose nose
sqlalchemy sqlalchemy
whoosh whoosh
@ -13,8 +12,24 @@ commands=
{envpython} tests/run.py {posargs} {envpython} tests/run.py {posargs}
sphinx-build -W -b html -d {envtmpdir}/doctrees doc {envtmpdir}/html sphinx-build -W -b html -d {envtmpdir}/doctrees doc {envtmpdir}/html
[testenv:py26]
deps=
mock
{[testenv]deps}
[testenv:py27]
deps=
mock
{[testenv]deps}
[testenv:py32]
deps=
mock
{[testenv]deps}
[testenv:pypy] [testenv:pypy]
deps= deps=
mock
simplejson simplejson
{[testenv]deps} {[testenv]deps}