def METHOD_NAME(self, count, spec):
    minend = plural_or_not(spec.minargs)
    if spec.minargs == spec.maxargs:
        expected = '%d argument%s' % (spec.minargs, minend)
    elif not spec.var_positional:
        expected = '%d to %d arguments' % (spec.minargs, spec.maxargs)
    else:
        expected = 'at least %d argument%s' % (spec.minargs, minend)
    if spec.var_named or spec.named_only:
        expected = expected.replace('argument', 'non-named argument')
    self._raise_error("expected %s, got %d" % (expected, count))