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

Repeat _each / _test hooks #164

Merged
merged 1 commit into from
Sep 13, 2021
Merged

Repeat _each / _test hooks #164

merged 1 commit into from
Sep 13, 2021

Conversation

Steap2448
Copy link
Contributor

Repeat _each and _test hooks when -r option is specified.

I didn't forget about

  • Tests
  • Changelog
  • Documentation

Close #161

@Steap2448 Steap2448 force-pushed the 161-repeat-each-hooks branch from ff15fb0 to 740335f Compare September 7, 2021 18:32
@Steap2448 Steap2448 requested a review from rosik September 7, 2021 18:33
Comment on lines 329 to 346
t.assert_equals(hooks, {
'before_each', 'before_test', 'test_a', 'after_each',
'before_each', 'before_test', 'test_a', 'after_each',
'before_each', 'test_b', 'after_test', 'after_each',
'before_each', 'test_b', 'after_test', 'after_each',
})
Copy link
Contributor

Choose a reason for hiding this comment

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

Would you like to extend it with before_all and after_all?

Also, are there tests that cover:

  • an error in before_each in conjunction with --repeat option
  • a case when n-th test fails

Copy link
Contributor Author

@Steap2448 Steap2448 Sep 8, 2021

Choose a reason for hiding this comment

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

Would you like to extend it with before_all and after_all?

I don't think that repeating _all hooks is a good idea. They are supposed to be before and after all tests (evidently), but with the repeat option it won't be this way.

Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't mean calling before_all twice but extending the test with it. Never mind, you can merge it as is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My bad. Added it to the test

@Steap2448 Steap2448 force-pushed the 161-repeat-each-hooks branch from 740335f to ace63c8 Compare September 8, 2021 12:00
@Steap2448 Steap2448 requested a review from rosik September 8, 2021 12:01
@Steap2448 Steap2448 force-pushed the 161-repeat-each-hooks branch from ace63c8 to 48f435b Compare September 13, 2021 11:59
@Steap2448 Steap2448 merged commit a7798e3 into master Sep 13, 2021
@Steap2448 Steap2448 deleted the 161-repeat-each-hooks branch September 13, 2021 12:03
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.

Option repeat don't care about setup/teardown
2 participants