Commits

Rob Ruana  committed 122bbbb

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

  • Participants
  • Parent commits d50b0d9

Comments (0)

Files changed (2)

File tests/test_napoleon.py

     :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)
 
 [testenv]
 deps=
-    mock
     nose
     sqlalchemy
     whoosh
     {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}