From 1e81d47099e7db69396007e128cc1416b39bfcf6 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Wed, 6 Aug 2014 16:06:46 +0400 Subject: [PATCH] [git tests] Don't call tearDown if fixture is not initialized yet Prefer super.tearDown in this case, otherwise fixture.tearDown will complain that it wasn't setUp yet. --- plugins/git4idea/tests/git4idea/test/GitPlatformTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/git4idea/tests/git4idea/test/GitPlatformTest.java b/plugins/git4idea/tests/git4idea/test/GitPlatformTest.java index dc2be2dfc1fa..c02ec553dd8f 100644 --- a/plugins/git4idea/tests/git4idea/test/GitPlatformTest.java +++ b/plugins/git4idea/tests/git4idea/test/GitPlatformTest.java @@ -81,7 +81,13 @@ public abstract class GitPlatformTest extends UsefulTestCase { try { myProjectFixture = IdeaTestFixtureFactory.getFixtureFactory().createFixtureBuilder(getTestName(true)).getFixture(); myProjectFixture.setUp(); + } + catch (Exception e) { + super.tearDown(); + throw e; + } + try { myProject = myProjectFixture.getProject(); myProjectRoot = myProject.getBaseDir(); myProjectPath = myProjectRoot.getPath();