Reinstate unittest > unittest2, move eventually to ./asynctest

This commit is contained in:
Eric 2025-03-24 17:20:59 +11:00
parent 50bbf8ac31
commit e970989205
No known key found for this signature in database
4 changed files with 14 additions and 8 deletions

View File

@ -1,3 +1,13 @@
import pkg/asynctest/chronos/unittest
import pkg/asynctest/chronos/unittest2
export unittest
export unittest2 except eventually
template eventually*(expression: untyped, timeout = 5000, pollInterval = 10): bool =
## Fast defaults, do not use with HTTP connections!
eventually(expression, timeout, pollInterval)
template eventuallySafe*(
expression: untyped, timeout = 5000, pollInterval = 1000
): bool =
## More sane defaults, for use with HTTP connections
eventually(expression, timeout = timeout, pollInterval = pollInterval)

View File

@ -38,7 +38,3 @@ proc allFuturesThrowing*[T, E]( # https://github.com/nim-lang/Nim/issues/23432
): Future[void] =
allFuturesThrowing(futs.mapIt(FutureBase(it)))
template eventuallySafe*(
expression: untyped, timeout = 5000, pollInterval = 1000
): bool =
eventually(expression, timeout, pollInterval)

View File

@ -1,5 +1,5 @@
import pkg/codex/streams/storestream
import std/unittest
import pkg/unittest2
# From lip2p/tests/helpers
const trackerNames = [StoreStreamTrackerName]

2
vendor/asynctest vendored

@ -1 +1 @@
Subproject commit 32df0f19d6e0e6f84c762cf8de7361ddb419f4ba
Subproject commit 73c08f77afc5cc2a5628d00f915b97bf72f70c9b