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: end-of-file-fixer
- id: check-yaml - id: check-yaml
- id: debug-statements - id: debug-statements
exclude: _pytest/debugging.py
- id: flake8 - id: flake8
- repo: https://github.com/asottile/pyupgrade - repo: https://github.com/asottile/pyupgrade
rev: v1.2.0 rev: v1.2.0

View File

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

View File

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