From 9e9547a9e4436bd6e7af2590e6f5bf3b1b024ad8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Est=C3=A8ve?= Date: Tue, 3 Jan 2017 12:03:26 +0100 Subject: [PATCH] Simplify condition --- _pytest/recwarn.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_pytest/recwarn.py b/_pytest/recwarn.py index 4fd41fa8a..9031bdbda 100644 --- a/_pytest/recwarn.py +++ b/_pytest/recwarn.py @@ -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(