summaryrefslogtreecommitdiff
path: root/mox.py
diff options
context:
space:
mode:
authorsmiddlek <smiddlek@b1010a0a-674b-0410-b734-77272b80c875>2012-11-16 19:17:52 +0000
committersmiddlek <smiddlek@b1010a0a-674b-0410-b734-77272b80c875>2012-11-16 19:17:52 +0000
commit160491d0384285698d726b1af21277f336107f51 (patch)
treeeac4e643847865508bdf7ff2db51525650a2530e /mox.py
parent836982b46ab9e1e60b12009aa5abab384131c697 (diff)
downloadmox-master.tar.gz
Patch for Issue #47, provided by gps@google.comHEADmaster
git-svn-id: http://pymox.googlecode.com/svn/trunk@75 b1010a0a-674b-0410-b734-77272b80c875
Diffstat (limited to 'mox.py')
-rwxr-xr-xmox.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/mox.py b/mox.py
index f250187..48f6391 100755
--- a/mox.py
+++ b/mox.py
@@ -61,6 +61,10 @@ Suggested usage / workflow:
my_mox.VerifyAll()
"""
+try:
+ import abc
+except ImportError:
+ abc = None # Python 2.5 and earlier
from collections import deque
import difflib
import inspect
@@ -260,6 +264,8 @@ class Mox(object):
# A list of types that may be stubbed out with a MockObjectFactory.
_USE_MOCK_FACTORY = [types.ClassType, types.ObjectType, types.TypeType]
+ if abc:
+ _USE_MOCK_FACTORY.append(abc.ABCMeta)
def __init__(self):
"""Initialize a new Mox."""