为什么 `testAndroidTestCaseSetupProperly` 需要这么长时间才能 运行?

Why does `testAndroidTestCaseSetupProperly` take so long to run?

当 运行 android 测试用例为什么 testAndroidTestCaseSetupProperly 花费这么长时间(我认为)它所做的只是检查 Context?似乎需要 10 到 20 秒。

在此处查看 Android 来源:https://android.googlesource.com/platform/frameworks/base/+/donut-release/core/java/android/test/AndroidTestCase.java

这是来源:

public void testAndroidTestCaseSetupProperly() {
    assertNotNull("Context is null. setContext should be called before tests are run",
            mContext);        
}

它所做的只是断言不是 null。我很确定一定是您的其他一些测试用例需要一段时间。

空,但官方文档在这里:http://developer.android.com/reference/android/test/AndroidTestCase.html#testAndroidTestCaseSetupProperly()