pytest_cases/common_pytest.py
def num_mock_patch_args(function):
        """ return number of arguments used up by mock arguments (if any) """
        patchings = getattr(function, "patchings", None)
        if not patchings:
            return 0

        mock_sentinel = getattr(sys.modules.get("mock"), "DEFAULT", object())
        ut_mock_sentinel = getattr(sys.modules.get("unittest.mock"), "DEFAULT", object())

        return len(
            [p for p in patchings if not p.attribute_name and (p.new is mock_sentinel or p.new is ut_mock_sentinel)]
        )
 return number of arguments used up by mock arguments (if any) 
return number of arguments used up by mock arguments (if any)
return number of arguments used up by mock arguments ( if any )
def num_mock_patch_args(function):
        patchings = getattr(function, "patchings", None)
        if not patchings:
            return 0
        mock_sentinel = getattr(sys.modules.get("mock"), "DEFAULT", object())
        ut_mock_sentinel = getattr(sys.modules.get("unittest.mock"), "DEFAULT", object())
        return len(
            [p for p in patchings if not p.attribute_name and (p.new is mock_sentinel or p.new is ut_mock_sentinel)]
        )
def num_mock_patch_args ( function ) : patchings = getattr ( function , "patchings" , None ) if not patchings : return 0 mock_sentinel = getattr ( sys . modules . get ( "mock" ) , "DEFAULT" , object ( ) ) ut_mock_sentinel = getattr ( sys . modules . get ( "unittest.mock" ) , "DEFAULT" , object ( ) ) return len ( [ p for p in patchings if not p . attribute_name and ( p . new is mock_sentinel or p . new is ut_mock_sentinel ) ] )
return number of arguments used up by mock arguments (if any)
return number of arguments used up by mock arguments ( if any )
""" return number of arguments used up by mock arguments (if any) """
function