summary refs log tree commit diff stats
path: root/lib/pure/unittest.nim
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pure/unittest.nim')
-rw-r--r--lib/pure/unittest.nim4
1 files changed, 4 insertions, 0 deletions
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