Android Studio “No tests were found”

Today I had the same problem with some Espresso tests and it was getting me crazy because everything seemed normal. Finally I discovered the problem was because the method annotated with @BeforeClass was throwing an exception. If something goes wrong in that method, the stacktrace of the exception is not shown in the Log window of the Run tab but in the Log window of the Android Monitor tab

If you want to reproduce the problem just add this to your testing class:

@BeforeClass
public static void setupClass() {
    throw new RuntimeException("Sorry dude, you won't find any test!");
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)