-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Failing a test from a finalizer within a plugin #3429
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
Comments
pytest itself considers a faiure in setup/teardown an actual error this can be elevated by a own Lines 144 to 152 in 015626c
and Lines 123 to 132 in ed118d7
do - i believe a tryfirst hook that integrates with your framework should suffice another alternative is to have the assertion happen within the test call hook |
@RonnyPfannschmidt Thanks for the help! FWIW here is my proposed fix: https://github.com/uber/doubles/pull/131/files |
@toddsifleet thanks for the link, i believe your question is resolved, please close the issue if that's the case |
Hi,
I am working on an issue from the mocking library doubles.
The doubles library sets and validates expectations (e.g.
expect(requests).post(...)
), in order to verify all expectations have been met for a particular test we run finalizer code to check (and teardown) each expectation (code).With our current code, the
doubles.verify
method may raise anAssertionError
(previously it calledpytest.fail
(change)). Unfortunately our implementation using a finalizer causes the test to be reported as anerror
not afailure
.I think this could be one of a few issues:
AssertionErrors
.If this is a bug/mistake in
doubles
code do you have any ideas about how we could update our pytest plugin to report theseAssertionErrors
asfailures
instead oferrors
?Thanks,
Todd
The text was updated successfully, but these errors were encountered: