dave08
03/31/2019, 8:45 AMsuspend
functions? I find tests with runBlocking
all over the place can be hard to read...dmcg
03/31/2019, 8:57 AMdave08
03/31/2019, 10:18 AMlaunch
from that scope...dmcg
03/31/2019, 10:40 AMdave08
03/31/2019, 10:44 AMit
used by the TestDescriptor
and this
used by the fixture? Yeah, it's a nice solution to provide a scope
property, anyways the scope is only used for `launch`ing or async
calls, most of the time I call suspend
functions that don't require one.robfletcher
03/31/2019, 4:11 PMsuspend
functions it wouldn’t matter if the actual tests involved coroutines or not. I mean, theoretically there’s a small performance penalty but we’re talking about unit tests here, it’s not going to be noticeable.dmcg
03/31/2019, 4:38 PMsuspend
all the way through, then at some point I will be responsible for providing the coroutine context - the problem being that there are potentially different contexts that could be used?dave08
03/31/2019, 7:55 PMwithContext
and the likes, so the starting point is probably runBlocking
. The solution I suggested is more of a hack I had used with Spek that made things livable... I agree with @robfletcher that having everything suspend
would be a better solution, if possible.dmcg
03/31/2019, 8:49 PMTest
that implements TestLet
that is a typealias for the thing that is actually run, and would need to be suspend
. But Suspend function type is not allowed as supertypes
dave08
04/01/2019, 2:48 AMsuspend
? AFAIK it should be in the typealias itself... where did you get the error?dmcg
04/01/2019, 7:57 AMdave08
04/01/2019, 8:09 AMby f
? Maybe just implement the delgation yourself (just one invoke function, no?). Or you really need the inheritance?dmcg
04/01/2019, 8:10 AMdave08
04/01/2019, 8:11 AMdmcg
04/01/2019, 8:13 AMdave08
04/01/2019, 8:20 AMcoroutineContext { }
once you have a base scope like runBlocking its running under. Like I said, the scope is only needed for using coroutine builders for concurency like launch or async, but to run regular suspend functions you wouldn't need a scopedmcg
04/01/2019, 8:22 AMdave08
04/01/2019, 8:25 AM