Whole file
flexmock/flexmock
The author described this change as “Fix exception type check when no message specified”. It counts as a record because the check below fails on the code as it stood at 08f4a8d7a and passes on 6eec0e26d, with nothing else changed between the two runs.
Projectflexmock/flexmock
Fix saved2011-03-27
Sharing licenceBSD-2-Clause · LICENSE
Change size+2 −2
What the code was meant to do, written into the code itself as a save note
Fix exception type check when no message specified
The change
| 596 | 596 | expected_instance = expected(*args['kargs'], **args['kwargs']) | |
| 597 | 597 | expected_message = '%s' % expected_instance | |
| 598 | 598 | if inspect.isclass(expected): | |
| 599 | - | if expected is not raised and not isinstance(raised, expected): | |
| 599 | + | if expected is not raised and expected not in raised.__bases__: | |
| 600 | 600 | raise (InvalidExceptionClass('expected %s, raised %s' % | |
| 601 | 601 | (expected, raised))) | |
| 602 | - | elif expected_message != message: | |
| 602 | + | if expected_message and expected_message != message: | |
| 603 | 603 | raise (InvalidExceptionMessage('expected %s, raised %s' % | |
| 604 | 604 | (expected_message, message))) | |
| 605 | 605 | elif expected is not raised: |
The check that tells the two apart
fail→pass·tests/flexmock_test.py::TestFlexmockUnittest::test_flexmock_should_match_spy_exception_parent_type
Check file tests/flexmock_test.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before it08f4a8d7a4bea793bde74e7b21bae782d1ed2c61
Broken version dated2011-03-06
Moduleflexmock
Units changedFlexMock
Fingerprintfb02152870799e48
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.