-
Notifications
You must be signed in to change notification settings - Fork 28
Add repeat-scope parameter #23
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
Conversation
|
Fixes #19 |
davehunt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this work when @pytest.mark.repeat(n) is applied to a class or another scope? Also, could you add some documentation for this new feature to the README?
|
Applying |
davehunt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks @gdyuldin! I've tested this out locally and it works really well. I just had a few comments on the documentation, but once they're taken care of I'd be happy to push a new release.
README.rst
Outdated
| pass | ||
| If you want to override default tests executions order, you can use :code:`--repeat-scope` | ||
| command line option with one of the next values: :code:`session`, :code:`module`, :code:`class` of :code:`function`(default). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: 'of' instead of 'or'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, function is not rendoring correctly, see https://github.com/gdyuldin/pytest-repeat/blob/31c85c7f9398b729c8c4abf46f491ea6512054ea/README.rst. I suspect you need a space before "(default)".
README.rst
Outdated
| If you want to override default tests executions order, you can use :code:`--repeat-scope` | ||
| command line option with one of the next values: :code:`session`, :code:`module`, :code:`class` of :code:`function`(default). | ||
| It behaves like a scope of the py.test fixture. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use "pytest" and not "py.test", as the dot was dropped in version 3.
README.rst
Outdated
| :code:`function` (default) scope repeats each test :code:`count` or :code:`repeat` times before executing next test. | ||
| :code:`session` scope repeats whole tests session, i.e. all collected tests executed once, then all such tests executed again and etc. | ||
| :code:`class` and :code: `module` behaves similar, but repeating tests block is all tests for class or module. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
module is not formatted, likely due to the space after ":code:"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear what you mean by "repeating tests block is all tests for class or module". Could you rephrase?
This parameter allows to change test execution order. For example, with `--repeat-scope session` all tests executes first time, next all tests executes second time and etc.
|
I've updated README |
This parameter allows to change test execution order.
For example, with
--repeat-scope sessionall tests executesfirst time, next all tests executes second time and etc.