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

Add test decorators that make test cases run multiple times #145

Merged
merged 18 commits into from
Jul 7, 2015

Conversation

delta2323
Copy link
Member

This PR fixes #85 .
This PR implements decorators for test cases that make them run multiple times.

Decorators are as follows

  • repeat_with_success_at_least(n, m) : Pass the test case if it succeeded m times among n trials.
  • retry(n) : Pass the test case if it succeeded at least once among n trials.
  • repeat(n) : Pass the test case if it succeeded all n trials.



class QuietTestRunner(object):
def run(self, suite):
Copy link
Member

Choose a reason for hiding this comment

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

Insert a blank line after class

@unnonouno
Copy link
Member

The code looks good. Please write a document about its specification, and make a unit test.

@unnonouno unnonouno self-assigned this Jul 6, 2015
@delta2323
Copy link
Member Author

I added documents and unit tests for the decorators.

def repeat_with_success_at_least(times, min_success):
"""Decorator for multiple trial of the test case

Decorated test case is launched multiple times.
Copy link
Member

Choose a reason for hiding this comment

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

"A decorated test case" ?

@unnonouno
Copy link
Member

LGTM except the comments. And, note that tests show no adequate error messages, as they only show "fail".

@unnonouno
Copy link
Member

LGTM

unnonouno added a commit that referenced this pull request Jul 7, 2015
Add test decorators that make test cases run multiple times
@unnonouno unnonouno merged commit 346a568 into master Jul 7, 2015
@unnonouno unnonouno deleted the test_multiple_times branch July 7, 2015 03:42
@okuta okuta modified the milestone: v1.1.0 Jul 7, 2015
@delta2323 delta2323 added cat:feature Implementation that introduces new interfaces. cat:test Test or CI related. and removed cat:feature Implementation that introduces new interfaces. labels Jul 7, 2015
niboshi added a commit to niboshi/chainer that referenced this pull request Jun 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat:test Test or CI related.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run numerical test multiple times
3 participants