diff --git a/src/main/java/org/pitest/testng/TestNGTestUnit.java b/src/main/java/org/pitest/testng/TestNGTestUnit.java index 23bd084..17f05c3 100644 --- a/src/main/java/org/pitest/testng/TestNGTestUnit.java +++ b/src/main/java/org/pitest/testng/TestNGTestUnit.java @@ -135,10 +135,20 @@ class FailFast implements IInvokedMethodListener { @Override public void beforeInvocation(IInvokedMethod method, ITestResult testResult) { - if (this.listener.hasHadFailure()) { + if (this.listener.hasHadFailure() && notAfterConfiguration(method)) { throw new SkipException("Skipping"); } } + + private boolean notAfterConfiguration(IInvokedMethod method) { + ITestNGMethod testMethod = method.getTestMethod(); + boolean flag = testMethod.isAfterClassConfiguration() + || testMethod.isAfterMethodConfiguration() + || testMethod.isAfterGroupsConfiguration() + || testMethod.isAfterSuiteConfiguration() + || testMethod.isAfterTestConfiguration(); + return !flag; + } @Override public void afterInvocation(IInvokedMethod method, ITestResult testResult) {