fixes unittest warnings (#21271)
This commit is contained in:
parent
cc08a9015e
commit
c4035d7f7c
1 changed files with 4 additions and 0 deletions
|
|
@ -544,11 +544,14 @@ template test*(name, body) {.dirty.} =
|
||||||
for formatter in formatters:
|
for formatter in formatters:
|
||||||
formatter.testStarted(name)
|
formatter.testStarted(name)
|
||||||
|
|
||||||
|
{.warning[BareExcept]:off.}
|
||||||
try:
|
try:
|
||||||
when declared(testSetupIMPLFlag): testSetupIMPL()
|
when declared(testSetupIMPLFlag): testSetupIMPL()
|
||||||
when declared(testTeardownIMPLFlag):
|
when declared(testTeardownIMPLFlag):
|
||||||
defer: testTeardownIMPL()
|
defer: testTeardownIMPL()
|
||||||
|
{.warning[BareExcept]:on.}
|
||||||
body
|
body
|
||||||
|
{.warning[BareExcept]:off.}
|
||||||
|
|
||||||
except:
|
except:
|
||||||
let e = getCurrentException()
|
let e = getCurrentException()
|
||||||
|
|
@ -570,6 +573,7 @@ template test*(name, body) {.dirty.} =
|
||||||
)
|
)
|
||||||
testEnded(testResult)
|
testEnded(testResult)
|
||||||
checkpoints = @[]
|
checkpoints = @[]
|
||||||
|
{.warning[BareExcept]:on.}
|
||||||
|
|
||||||
proc checkpoint*(msg: string) =
|
proc checkpoint*(msg: string) =
|
||||||
## Set a checkpoint identified by `msg`. Upon test failure all
|
## Set a checkpoint identified by `msg`. Upon test failure all
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue