No tests found for given includes Error, when running Parameterized Unit test in Android Studio

前端 未结 17 2031
孤独总比滥情好
孤独总比滥情好 2021-01-31 07:03

I tried run Parameterized Unit Test as below in Android Studio.

import android.test.suitebuilder.annotation.SmallTest;  

import junit.framework.TestCase;    

i         


        
17条回答
  •  时光说笑
    2021-01-31 07:26

    In my case, the problem occurred when writing in Kotlin and using IDEA 2020.3. Despite proper entries in build.gradle.kts. It turned out that the problem was when generating test functions by IDEA IDE (Alt + Insert). It generates the following code:

    @Test
       internal fun name () {
         TODO ("Not yet implemented")
       }
    

    And the problem will be fixed after removing the "internal" modifier:

    @Test
       fun name () {
         TODO ("Not yet implemented")
       }
    

提交回复
热议问题