summaryrefslogtreecommitdiff
path: root/mox.py
diff options
context:
space:
mode:
Diffstat (limited to 'mox.py')
-rwxr-xr-xmox.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/mox.py b/mox.py
index 482acd0..f250187 100755
--- a/mox.py
+++ b/mox.py
@@ -600,7 +600,10 @@ class MockObject(MockAnything, object):
pass
for method in dir(class_to_mock):
- attr = getattr(class_to_mock, method)
+ try:
+ attr = getattr(class_to_mock, method)
+ except AttributeError:
+ continue
if callable(attr):
self._known_methods.add(method)
elif not (type(attr) is property):
@@ -2062,7 +2065,11 @@ class MoxMetaTestBase(type):
for base in bases:
for attr_name in dir(base):
if attr_name not in d:
- d[attr_name] = getattr(base, attr_name)
+ try:
+ attr_value = getattr(base, attr_name)
+ except AttributeValue:
+ continue
+ d[attr_name] = attr_value
for func_name, func in d.items():
if func_name.startswith('test') and callable(func):