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
Guard against multiple evaluations of before statement #1821
Guard against multiple evaluations of before statement #1821
Conversation
Some rules evaluate the base statement multiple times, e.g. to execute tests repeatedly. The changes made in mockito#1672 led to an exception in such cases because the `MockitoListener` was registered multiple times. Now, we only add the listener the first time the statement is evaluated in order to restore the old behavior. Fixes mockito#1767.
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 makes sense, thanks for reaching out again and fixing it!!
Oh, this fails a lot of tests 😢 Could it be that |
It does indeed. 👍 |
Codecov Report
@@ Coverage Diff @@
## release/3.x #1821 +/- ##
=================================================
+ Coverage 86.71% 86.71% +<.01%
Complexity 2492 2492
=================================================
Files 311 311
Lines 6549 6551 +2
Branches 821 822 +1
=================================================
+ Hits 5679 5681 +2
Misses 674 674
Partials 196 196
Continue to review full report at Codecov.
|
Awesome thanks! |
* Guard against multiple evaluations of before statement Some rules evaluate the base statement multiple times, e.g. to execute tests repeatedly. The changes made in mockito#1672 led to an exception in such cases because the `MockitoListener` was registered multiple times. Now, we only add the listener the first time the statement is evaluated in order to restore the old behavior. Fixes mockito#1767. * Reset listener when removing it
Some rules evaluate the base statement multiple times, e.g. to execute
tests repeatedly. The changes made in #1672 led to an exception in such
cases because the
MockitoListener
was registered multiple times. Now,we only add the listener the first time the statement is evaluated in
order to restore the old behavior.
Fixes #1767.