@@ -547,14 +547,11 @@ template test*(name, body) {.dirty.} =
547547 for formatter in formatters:
548548 formatter.testStarted (name)
549549
550- {.push warning [BareExcept ]:off .}
551550 try :
552551 when declared (testSetupIMPLFlag): testSetupIMPL ()
553552 when declared (testTeardownIMPLFlag):
554553 defer : testTeardownIMPL ()
555- {.push warning [BareExcept ]:on .}
556554 body
557- {.pop .}
558555
559556 except Exception :
560557 let e = getCurrentException ()
@@ -577,7 +574,6 @@ template test*(name, body) {.dirty.} =
577574 )
578575 testEnded (testResult)
579576 checkpoints = @ []
580- {.pop .}
581577
582578proc checkpoint * (msg: string ) =
583579 # # Set a checkpoint identified by `msg`. Upon test failure all
@@ -801,11 +797,8 @@ macro expect*(exceptions: varargs[typed], body: untyped): untyped =
801797 discard
802798
803799 template expectBody (errorTypes, lineInfoLit, body): NimNode {.dirty .} =
804- {.push warning [BareExcept ]:off .}
805800 try :
806- {.push warning [BareExcept ]:on .}
807801 body
808- {.pop .}
809802 checkpoint (lineInfoLit & " : Expect Failed, no exception was thrown." )
810803 fail ()
811804 except errorTypes:
@@ -814,8 +807,6 @@ macro expect*(exceptions: varargs[typed], body: untyped): untyped =
814807 let err = getCurrentException ()
815808 checkpoint (lineInfoLit & " : Expect Failed, " & $ err.name & " was thrown." )
816809 fail ()
817- {.pop .}
818-
819810 var errorTypes = newNimNode (nnkBracket)
820811 var hasException = false
821812 for exp in exceptions:
0 commit comments