]> arthur.barton.de Git - bup.git/commitdiff
Fail the tests if we detect any AssertionErrors
authorJohannes Berg <johannes@sipsolutions.net>
Wed, 24 Nov 2021 20:42:34 +0000 (21:42 +0100)
committerRob Browning <rlb@defaultvalue.org>
Sun, 9 Jan 2022 18:36:56 +0000 (12:36 -0600)
This exposed various problems in the recent contextmanagement work,
e.g. the assertions in the __del__ methods had been failing.  Of
course this means that from now on, asserts should only be used to
detect fatal problems.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
[rlb@defaultvalue.org: adjust commit message]
Tested-by: Rob Browning <rlb@defaultvalue.org>
test/ext/conftest.py

index 2c8f03e8e9d45dd00cea7ebd26bd6ea2c320b625..ed30973e39f4d8c2e49e5958ca4aa4323bc60fda 100644 (file)
@@ -36,6 +36,8 @@ class BupSubprocTestRunner(pytest.Item):
         failures = [line for line in lines
                     if (line.startswith(b'!')
                         and line.lower().endswith(b' failed'))]
+        if b'AssertionError' in out:
+            raise BupSubprocFailure('AssertionError detected')
         if failures or p.returncode != 0:
             raise BupSubprocFailure('%s failed (exit %d, %d failures)'
                                     % (cmd, p.returncode, len(failures)),