Fix for unittest2 > 0.0.9

Define our templates inside a new scope, to make sure
that they don't clash with the unittest2 templates.
This commit is contained in:
Mark Spanbroek 2023-12-20 14:26:17 +01:00
parent 9f31323a5f
commit 33af46fc3f
2 changed files with 25 additions and 25 deletions

View File

@ -20,6 +20,7 @@ template launderExceptions(body: typed) =
template suite*(name, body) =
suite name:
let suiteproc = proc = # Avoids GcUnsafe2 warnings with chronos
## Runs before all tests in the suite
template setupAll(setupAllBody) {.used.} =
@ -44,7 +45,6 @@ template suite*(name, body) =
waitFor asyncproc()
setCurrentException(exception)
let suiteproc = proc = # Avoids GcUnsafe2 warnings with chronos
body
when declared(teardownAllIMPL):

View File

@ -3,7 +3,7 @@ author = "Asynctest Authors"
description = "Asynctest tests for pkg/unittest2 and pkg/chronos"
license = "MIT"
requires "unittest2 <= 0.0.9"
requires "unittest2"
requires "chronos"
task test, "Runs the test suite":