File tree 2 files changed +5
-0
lines changed
2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -251,6 +251,8 @@ internal class TestScopeImpl(context: CoroutineContext) :
251
251
/* * Called at the end of the test. May only be called once. Returns the list of caught unhandled exceptions. */
252
252
fun leave (): List <Throwable > = synchronized(lock) {
253
253
check(entered && ! finished)
254
+ /* * After [finished] becomes `true`, it is no longer valid to have [reportException] as the callback. */
255
+ ExceptionCollector .removeOnExceptionCallback(lock)
254
256
finished = true
255
257
uncaughtExceptions
256
258
}
Original file line number Diff line number Diff line change
1
+ import kotlinx .coroutines .CoroutineExceptionHandler ;
1
2
import kotlinx .coroutines .internal .MainDispatcherFactory ;
3
+ import kotlinx .coroutines .test .internal .ExceptionCollectorAsService ;
2
4
import kotlinx .coroutines .test .internal .TestMainDispatcherFactory ;
3
5
4
6
module kotlinx .coroutines .test {
8
10
exports kotlinx .coroutines .test ;
9
11
10
12
provides MainDispatcherFactory with TestMainDispatcherFactory ;
13
+ provides CoroutineExceptionHandler with ExceptionCollectorAsService ;
11
14
}
You can’t perform that action at this time.
0 commit comments