Skip to content

Commit 0229896

Browse files
committed
Simplify condition
1 parent 2c46a22 commit 0229896

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

_pytest/recwarn.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ def __exit__(self, *exc_info):
216216
# only check if we're not currently handling an exception
217217
if all(a is None for a in exc_info):
218218
if self.expected_warning is not None:
219-
if not any(issubclass(r.category, exp_warning) for
220-
exp_warning in self.expected_warning for r in self):
219+
if not any(issubclass(r.category, self.expected_warning)
220+
for r in self):
221221
__tracebackhide__ = True
222222
pytest.fail("DID NOT WARN. No warnings of type {0} was emitted. "
223223
"The list of emitted warnings is: {1}.".format(

0 commit comments

Comments
 (0)