From c4035d7f7c424caa81ee449d2032ecd8e8967ebd Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Wed, 18 Jan 2023 16:03:03 +0800 Subject: fixes unittest warnings (#21271) --- lib/pure/unittest.nim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/pure/unittest.nim b/lib/pure/unittest.nim index c87fe38f1..9dafa8f03 100644 --- a/lib/pure/unittest.nim +++ b/lib/pure/unittest.nim @@ -544,11 +544,14 @@ template test*(name, body) {.dirty.} = for formatter in formatters: formatter.testStarted(name) + {.warning[BareExcept]:off.} try: when declared(testSetupIMPLFlag): testSetupIMPL() when declared(testTeardownIMPLFlag): defer: testTeardownIMPL() + {.warning[BareExcept]:on.} body + {.warning[BareExcept]:off.} except: let e = getCurrentException() @@ -570,6 +573,7 @@ template test*(name, body) {.dirty.} = ) testEnded(testResult) checkpoints = @[] + {.warning[BareExcept]:on.} proc checkpoint*(msg: string) = ## Set a checkpoint identified by `msg`. Upon test failure all -- cgit 1.4.1-2-gfad0