summaryrefslogtreecommitdiff
path: root/mock.py
diff options
context:
space:
mode:
authorMichael Foord <michael@voidspace.org.uk>2012-01-05 12:58:32 +0000
committerMichael Foord <michael@voidspace.org.uk>2012-01-05 12:58:32 +0000
commit6068c8652a72b51f4e3b15694624c2c45ff6bd77 (patch)
treeb5c60dc30a5860324b2874d9ea041dd25320f7e3 /mock.py
parent0ac60d5e3c2ee9e3cd47427ffae685293617376c (diff)
downloadmock-6068c8652a72b51f4e3b15694624c2c45ff6bd77.tar.gz
Renamed parameter
Diffstat (limited to 'mock.py')
-rw-r--r--mock.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/mock.py b/mock.py
index b85766d..722ab40 100644
--- a/mock.py
+++ b/mock.py
@@ -2186,7 +2186,7 @@ def create_autospec(spec, spec_set=False, instance=False, _parent=None,
return mock
-def _must_skip(spec, entry, skipfirst):
+def _must_skip(spec, entry, is_type):
if not isinstance(spec, ClassTypes):
if entry in getattr(spec, '__dict__', {}):
# instance attribute - shouldn't skip
@@ -2195,7 +2195,7 @@ def _must_skip(spec, entry, skipfirst):
spec = spec.__class__
if not hasattr(spec, '__mro__'):
# old style class: can't have descriptors anyway
- return skipfirst
+ return is_type
for klass in spec.__mro__:
result = klass.__dict__.get(entry, DEFAULT)
@@ -2203,10 +2203,11 @@ def _must_skip(spec, entry, skipfirst):
continue
if isinstance(result, (staticmethod, classmethod)):
return False
- return skipfirst
+ return is_type
- # shouldn't get here unless attribute dynamically provided
- return skipfirst
+ # shouldn't get here unless function is a dynamically provided attribute
+ # XXXX untested behaviour
+ return is_type
def _get_class(obj):