use sys.modules.get correctly and reference DEFAULT with respect to it
This commit is contained in:
parent
c3f4eb6d57
commit
e3b9382122
|
@ -1836,10 +1836,10 @@ def getfuncargnames(function, startindex=None):
|
||||||
if startindex is None:
|
if startindex is None:
|
||||||
startindex = inspect.ismethod(function) and 1 or 0
|
startindex = inspect.ismethod(function) and 1 or 0
|
||||||
if realfunction != function:
|
if realfunction != function:
|
||||||
mock_default = sys.modules.get('mock.DEFAULT')
|
mock = sys.modules.get('mock')
|
||||||
if mock_default:
|
if mock is not None:
|
||||||
for patching in getattr(function, "patchings", []):
|
for patching in getattr(function, "patchings", []):
|
||||||
if not patching.attribute_name and patching.new is DEFAULT:
|
if not patching.attribute_name and patching.new is mock.DEFAULT:
|
||||||
startindex += 1
|
startindex += 1
|
||||||
else:
|
else:
|
||||||
startindex += len(getattr(function, "patchings", []))
|
startindex += len(getattr(function, "patchings", []))
|
||||||
|
|
Loading…
Reference in New Issue