-
Notifications
You must be signed in to change notification settings - Fork 59
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
Refactor pytest plugin. #76
Conversation
This commit partially rewrites the pytest plugin so that retrying a test includes setup and teardown of test fixtures. This is a potentially **breaking change**, but it actually matches up with how the nose plugin works and is probably what most users would want. Fixes #53.
Verified that @Jeff-Meadows has signed the CLA. Thanks for the pull request! |
|
|
||
[testenv:pylint] | ||
commands = | ||
pylint --rcfile=.pylintrc flaky | ||
pylint --rcfile=.pylintrc test -d C0330 | ||
pylint --rcfile=.pylintrc test -d C0330,W0621 |
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.
Why this addition?
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.
That's the redefined outer name warning that has to be disabled every time you use a pytest fixture from within the same module where it's defined.
is this released to pypi? I think it may fix a problem I'm having with Flaky and Django tests... if the flaky test fails then the I haven't got to the bottom of it yet but seems likely related to not doing the setUp/tearDown as expected |
Hi @anentropic I plan to release it to pypi soon! |
@@ -100,6 +100,16 @@ def _log_intermediate_failure(self, err, flaky, name): | |||
) | |||
self._log_test_failure(name, err, message) | |||
|
|||
def _should_handle_test_error_or_failure(self, test, name, err): |
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.
docstring. And maybe a namedtuple return type for clarity?
Leave a note in the docstring about this function needing to be pure (not setting any state)
👍 |
This should be a major version bump. |
def pytest_testnodedown(self, node, error): | ||
""" | ||
Pytest hook for responding to a test node shutting down. |
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.
add a blank line after this for pep257 compliance?
(oh, already merged, sorry!)
This commit partially rewrites the pytest plugin so that retrying a test
includes setup and teardown of test fixtures.
This is a potentially breaking change, but it actually matches up
with how the nose plugin works and is probably what most users would want.
Fixes #53.