From e3b938212210056aecc55dbc3077a2ac956a3803 Mon Sep 17 00:00:00 2001 From: Chris Gilling Date: Wed, 26 Mar 2014 09:36:02 -0700 Subject: [PATCH] use sys.modules.get correctly and reference DEFAULT with respect to it --- _pytest/python.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_pytest/python.py b/_pytest/python.py index 50eb870b9..7bb9ea691 100644 --- a/_pytest/python.py +++ b/_pytest/python.py @@ -1836,10 +1836,10 @@ def getfuncargnames(function, startindex=None): if startindex is None: startindex = inspect.ismethod(function) and 1 or 0 if realfunction != function: - mock_default = sys.modules.get('mock.DEFAULT') - if mock_default: + mock = sys.modules.get('mock') + if mock is not None: 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 else: startindex += len(getattr(function, "patchings", []))