Upgrade pre-commit hooks except pyupgrade

This commit is contained in:
Anthony Sottile
2018-06-26 06:35:27 -07:00
parent 8133d1955e
commit cbaa7dd56a
86 changed files with 309 additions and 631 deletions

View File

@@ -21,7 +21,6 @@ def cached_eval(config, expr, d):
class MarkEvaluator(object):
def __init__(self, item, name):
self.item = item
self._marks = None

View File

@@ -25,9 +25,10 @@ def alias(name, warning=None):
def istestfunc(func):
return hasattr(func, "__call__") and getattr(
func, "__name__", "<lambda>"
) != "<lambda>"
return (
hasattr(func, "__call__")
and getattr(func, "__name__", "<lambda>") != "<lambda>"
)
def get_empty_parameterset_mark(config, argnames, func):
@@ -40,18 +41,20 @@ def get_empty_parameterset_mark(config, argnames, func):
raise LookupError(requested_mark)
fs, lineno = getfslineno(func)
reason = "got empty parameter set %r, function %s at %s:%d" % (
argnames, func.__name__, fs, lineno
argnames,
func.__name__,
fs,
lineno,
)
return mark(reason=reason)
class ParameterSet(namedtuple("ParameterSet", "values, marks, id")):
@classmethod
def param(cls, *values, **kw):
marks = kw.pop("marks", ())
if isinstance(marks, MarkDecorator):
marks = marks,
marks = (marks,)
else:
assert isinstance(marks, (tuple, list, set))
@@ -88,7 +91,7 @@ class ParameterSet(namedtuple("ParameterSet", "values, marks, id")):
argval = argval.args[-1]
assert not isinstance(argval, ParameterSet)
if legacy_force_tuple:
argval = argval,
argval = (argval,)
if newmarks:
warnings.warn(MARK_PARAMETERSET_UNPACKING)
@@ -333,6 +336,7 @@ class MarkGenerator(object):
will set a 'slowtest' :class:`MarkInfo` object
on the ``test_function`` object. """
_config = None
def __getattr__(self, name):
@@ -362,7 +366,6 @@ MARK_GEN = MarkGenerator()
class NodeKeywords(MappingMixin):
def __init__(self, node):
self.node = node
self.parent = node.parent
@@ -409,6 +412,7 @@ class NodeMarkers(object):
unstable api
"""
own_markers = attr.ib(default=attr.Factory(list))
def update(self, add_markers):