sort out pyupgrade fallout

This commit is contained in:
Ronny Pfannschmidt 2018-05-18 10:48:44 +02:00
parent 86fc31db8d
commit 3e1590bcfc
4 changed files with 15 additions and 10 deletions

View File

@ -13,6 +13,7 @@ repos:
- id: end-of-file-fixer
- id: check-yaml
- id: debug-statements
exclude: _pytest/debugging.py
- id: flake8
- repo: https://github.com/asottile/pyupgrade
rev: v1.2.0

View File

@ -218,7 +218,7 @@ def reorder_items_atscope(items, argkeys_cache, items_by_argkey, scopenum):
break
if no_argkey_group:
no_argkey_group = reorder_items_atscope(
no_argkey_group, argkeys_cache, items_by_argkey, scopenum + 1)
no_argkey_group, argkeys_cache, items_by_argkey, scopenum + 1)
for item in no_argkey_group:
items_done[item] = None
ignore.add(slicing_argkey)
@ -682,10 +682,10 @@ class FixtureLookupErrorRepr(TerminalRepr):
lines = self.errorstring.split("\n")
if lines:
tw.line('{} {}'.format(FormattedExcinfo.fail_marker,
lines[0].strip()), red=True)
lines[0].strip()), red=True)
for line in lines[1:]:
tw.line('{} {}'.format(FormattedExcinfo.flow_marker,
line.strip()), red=True)
line.strip()), red=True)
tw.line()
tw.line("%s:%d" % (self.filename, self.firstlineno + 1))
@ -854,7 +854,7 @@ class FixtureFunctionMarker(object):
if getattr(function, "_pytestfixturefunction", False):
raise ValueError(
"fixture is being applied more than once to the same function")
"fixture is being applied more than once to the same function")
function._pytestfixturefunction = self
return function

View File

@ -227,7 +227,9 @@ class WarningsChecker(WarningsRecorder):
if re.compile(self.match_expr).search(str(r.message)):
break
else:
fail("DID NOT WARN. No warnings of type {} matching"
" ('{}') was emitted. The list of emitted warnings"
" is: {}.".format(self.expected_warning, self.match_expr,
[each.message for each in self]))
fail(
"DID NOT WARN. No warnings of type {} matching"
" ('{}') was emitted. The list of emitted warnings"
" is: {}.".format(
self.expected_warning, self.match_expr,
[each.message for each in self]))

View File

@ -747,8 +747,10 @@ class TestFunctional(object):
items = {x.name: x for x in items}
for name, expected_markers in expected.items():
markers = items[name].keywords._markers
marker_names = {name for (name, v) in markers.items()
if isinstance(v, MarkInfo)}
marker_names = {
name for (name, v) in markers.items()
if isinstance(v, MarkInfo)
}
assert marker_names == set(expected_markers)
@pytest.mark.issue1540