Simplify condition
This commit is contained in:
parent
7930a8373d
commit
9e9547a9e4
|
@ -216,8 +216,8 @@ class WarningsChecker(WarningsRecorder):
|
||||||
# only check if we're not currently handling an exception
|
# only check if we're not currently handling an exception
|
||||||
if all(a is None for a in exc_info):
|
if all(a is None for a in exc_info):
|
||||||
if self.expected_warning is not None:
|
if self.expected_warning is not None:
|
||||||
if not any(issubclass(r.category, exp_warning) for
|
if not any(issubclass(r.category, self.expected_warning)
|
||||||
exp_warning in self.expected_warning for r in self):
|
for r in self):
|
||||||
__tracebackhide__ = True
|
__tracebackhide__ = True
|
||||||
pytest.fail("DID NOT WARN. No warnings of type {0} was emitted. "
|
pytest.fail("DID NOT WARN. No warnings of type {0} was emitted. "
|
||||||
"The list of emitted warnings is: {1}.".format(
|
"The list of emitted warnings is: {1}.".format(
|
||||||
|
|
Loading…
Reference in New Issue