mardi 24 septembre 2019

Why Android junit test fails if assumtion fails in @BeforeClass but is ignored is it fails in @Before?

I have a test that I want to only run if a certain condition is met.

To do this I have an org.junit.Assume.assumeTrue(...) in my test class.

However depending on whether I put it in the @BeforeClass method of in the @Before method, it either fails all the tests in the class (I get an error Expected x tests, got y tests) or correctly ignores the test.

I run tests using ./gradlew connectedDebugAndroidTest.

Is this intended or a bug in runner/gradle?

Aucun commentaire:

Enregistrer un commentaire