Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't run test if exception was thrown in _before of a module #4197

Merged

Conversation

Naktibalda
Copy link
Member

I fixed that for all test formats except Unit - it has to be fixed in PHPUnit.
One more reason to use Codeception formats.

Closes #4191

} catch (\Exception $er) {
// failure is created: not a user's test code error so we don't need detailed stacktrace
$this->testResult->addError($this, new \PHPUnit_Framework_AssertionFailedError($er->getMessage()), 0);
$this->ignored = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure why the test was executed even when it was marked as ignored 😕

@DavertMik
Copy link
Member

Thanks. Very nice fix

@DavertMik DavertMik merged commit d24aa1e into Codeception:2.2 May 8, 2017
@ghost
Copy link

ghost commented May 21, 2017

I run 26 tests. And if the second does not pass, then all other tests are not performed. It's horrible.

@Naktibalda
Copy link
Member Author

I know, it is fixed already and will be released soon.
Please downgrade to 2.2.10 if 2.2.11 is unusable.

@Naktibalda Naktibalda deleted the dont-run-test-if-before-failed branch May 21, 2017 21:44
chris1312 pushed a commit to chris1312/Codeception that referenced this pull request Jun 16, 2017
…ption#4197)

* Created tests for execution when exception is thrown in _before of module

* Don't run test if exception was thrown in _before of module

Works in all formats except Unit
Closes Codeception#4191
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants