Simplify condition

This commit is contained in:
Loïc Estève 2017-01-03 12:03:26 +01:00 committed by Bruno Oliveira
parent 7930a8373d
commit 9e9547a9e4
1 changed files with 2 additions and 2 deletions

View File

@ -216,8 +216,8 @@ class WarningsChecker(WarningsRecorder):
# only check if we're not currently handling an exception
if all(a is None for a in exc_info):
if self.expected_warning is not None:
if not any(issubclass(r.category, exp_warning) for
exp_warning in self.expected_warning for r in self):
if not any(issubclass(r.category, self.expected_warning)
for r in self):
__tracebackhide__ = True
pytest.fail("DID NOT WARN. No warnings of type {0} was emitted. "
"The list of emitted warnings is: {1}.".format(