Skip to content

Commit

Permalink
Closes sphinx-doc#1410: imports Mock from unittest.mock when availabl…
Browse files Browse the repository at this point in the history
…e (Python >=3.3)
  • Loading branch information
RelentlessIdiot committed Mar 6, 2014
1 parent 02363c3 commit 5564012
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
6 changes: 5 additions & 1 deletion tests/test_napoleon.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
: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.ext.napoleon import (_process_docstring, _skip_member, Config,
setup)
Expand Down
17 changes: 16 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ envlist=py26,py27,py32,py33,pypy,du11,du10

[testenv]
deps=
mock
nose
sqlalchemy
whoosh
Expand All @@ -13,8 +12,24 @@ commands=
{envpython} tests/run.py {posargs}
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]
deps=
mock
simplejson
{[testenv]deps}

Expand Down

0 comments on commit 5564012

Please sign in to comment.