Commit 3b630a0a authored by Jason Madden's avatar Jason Madden

Tests work without the backport of mock.

parent 3a4c73b4
......@@ -128,9 +128,20 @@ def gc_collect_if_needed():
if PYPY: # pragma: no cover
gc.collect()
# Our usage of mock should be limited to '@mock.patch()'
# and other things that are easily...mocked...here on Python 2
# when mock is not installed.
try:
from unittest import mock
except ImportError: # Python 2
try:
import mock
except ImportError: # pragma: no cover
# Backport not installed
class mock(object):
@staticmethod
def patch(reason):
return unittest.skip(reason)
mock = mock
......@@ -27,7 +27,7 @@ import unittest
try:
import objgraph
except ImportError:
except ImportError: # pragma: no cover
# Optional test dependency
objgraph = None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment