kotest
kotest copied to clipboard
Kotest runs `afterProject`, `afterSpec` on spec even if all of its tests are excluded by tag expression
Kotest 5.9.1/master
Example: Self-testing Kotest with
./gradlew -p kotest-framework/kotest-framework-engine cleanAllTests jvmTest -Dkotest.tags=Deprecated --no-build-cache
produces (among others):
io.kotest.assertions.AssertionFailedError: expected:<3> but was:<0>
at com.sksamuel.kotest.engine.spec.style.FreeSpecTest.afterSpec(FreeSpecTest.kt:15)
io.kotest.assertions.AssertionFailedError: expected:<8> but was:<7>
at com.sksamuel.kotest.engine.extensions.spec.finalizespec.FinalizeSpecListenerPerTestTest$1.invoke(FinalizeSpecListenerPerTestTest.kt:43)
Related: #3419
Should afterProject run regardless? Maybe it should? afterSpec should not (I have a PR up for that).
Yeah, I guess always running afterProject is OK. Needs to be documented.