Message247690
In issue http://bugs.python.org/issue21238 a feature was introduced to help prevent false-positive test cases by throwing an AttributeError whenever a non-existent method prefixed with "assert_" is used on a mock object.
I had mock objects with legitimate "assert_*" methods that had been working for some time. My tests included calls like:
my_mock.assert_in_status.assert_called_once_with(...)
My tests started failing unexpectedly and it took me HOURS to figure out that I had a new mock version installed. Those hours could have been turned into seconds my simply giving a better error message, something like:
AttributeError: you used "assert_in_status" but that method is not a valid Mock assert method. Please check your spelling. If this was not a typing mistake, you can use the `unsafe` keyword argument to the Mock instance to turn this validation check off. See https://mock-docs...org/ for more details. |
|
Date |
User |
Action |
Args |
2015-07-30 19:07:05 | Randy Syring | set | recipients:
+ Randy Syring |
2015-07-30 19:07:05 | Randy Syring | set | messageid: <1438283225.26.0.251368779344.issue24758@psf.upfronthosting.co.za> |
2015-07-30 19:07:05 | Randy Syring | link | issue24758 messages |
2015-07-30 19:07:04 | Randy Syring | create | |
|