Skip to content

Commit

Permalink
Adding Finally To Ensure Suite After Always Runs, Even If Exception O…
Browse files Browse the repository at this point in the history
…ccurs (#5224)
  • Loading branch information
Fenikkusu authored and DavertMik committed Oct 16, 2018
1 parent 9623771 commit 84e14d4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Codeception/SuiteManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,11 @@ public function run(PHPUnit\Runner $runner, \PHPUnit\Framework\TestResult $resul
{
$runner->prepareSuite($this->suite, $options);
$this->dispatcher->dispatch(Events::SUITE_BEFORE, new Event\SuiteEvent($this->suite, $result, $this->settings));
$runner->doEnhancedRun($this->suite, $result, $options);
$this->dispatcher->dispatch(Events::SUITE_AFTER, new Event\SuiteEvent($this->suite, $result, $this->settings));
try {
$runner->doEnhancedRun($this->suite, $result, $options);
} finally {
$this->dispatcher->dispatch(Events::SUITE_AFTER, new Event\SuiteEvent($this->suite, $result, $this->settings));
}
}

/**
Expand Down

0 comments on commit 84e14d4

Please sign in to comment.