Add an option to the logger to immediately fatal on first error

* This is mostly useful for some of the tests that want to be able to run and
  accumulate multiple errors, but while debugging we want an exception to catch.
This commit is contained in:
baldurk
2026-09-11 21:17:19 +01:00
parent d56ea92fd5
commit f58d376b3a
+4
View File
@@ -32,6 +32,7 @@ class TestLogger:
self.ctx_callback: Callable[[], None] | None = None
self.outputs: List[IO[str]] = [sys.stdout]
self.failed = False
self.fast_fail = False
self.section_failed = False
self.logged_exception = False
self.mutex = threading.Lock()
@@ -158,6 +159,9 @@ class TestLogger:
self.rawprint("!! " + message)
if self.fast_fail:
raise TestFailureException("Forcing failure")
def failure(self, ex: Exception):
if self.logged_exception:
return