From 33151372df628b42ed5e143afc40a2bf131ffe2a Mon Sep 17 00:00:00 2001 From: Lars Karlitski Date: Sun, 2 Jun 2019 19:52:59 +0200 Subject: [PATCH] test: Don't wait on --sit when test succeeds Python's `filter()` returns a "filter object", which is truthy. --- test/composertest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/composertest.py b/test/composertest.py index 2a5f990c..4f68bc63 100644 --- a/test/composertest.py +++ b/test/composertest.py @@ -57,7 +57,8 @@ class ComposerTestCase(unittest.TestCase): def tearDown(self): # Peek into internal data structure, because there's no way to get the # TestResult at this point. `errors` is a list of tuples (method, error) - errors = filter(None, [ e[1] for e in self._outcome.errors ]) + errors = list(e[1] for e in self._outcome.errors if e[1]) + if errors and self.sit: for e in errors: print_exception(*e)