You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
no longer seems to work when trying to assert the count of four. The error message spits out the following instead:
Failed asserting that actual size 0 matches expected size 4
Current behavior
I initially came across this in my own code, but found the example linked above. My generator definitely holds some values, and is being iterated in the assertCount() check, but the error message is just wrong.
How to reproduce
Just execute the example linked above.
Expected behavior
Something along the lines of:
Failed asserting that actual size 3 matches expected size 4
The text was updated successfully, but these errors were encountered:
I found this was because the generator cannot be cloned and can only be iterated over once. The actual count was correctly determined in the matches function. However, then the failureDescription attempts to iterate over the generator a second time to provide the failure details, resulting in the null count for the message.
One solution could be to store the actual count result inside the matches method for use in the failureDescription to provide the expected behavior.
Summary
The original sample at #3302 (comment)
no longer seems to work when trying to assert the count of four. The error message spits out the following instead:
Failed asserting that actual size 0 matches expected size 4
Current behavior
I initially came across this in my own code, but found the example linked above. My generator definitely holds some values, and is being iterated in the assertCount() check, but the error message is just wrong.
How to reproduce
Just execute the example linked above.
Expected behavior
Something along the lines of:
Failed asserting that actual size 3 matches expected size 4
The text was updated successfully, but these errors were encountered: