Daily updates from Odoo
Tuesday, November 5, 2019
1 change
Enhancements to existing features
Odoo's internal test tools now support custom messages when checking that errors are raised, matching standard Python behavior. This helps developers understand test failures more quickly and keeps existing tests aligned with expected conventions.
Original PR description
The unittest signature of `assertRaises` allows a named parameter `msg`. (see the official documentation [1]). The message is displayed in case of assertion failure. The Odoo implementation of assertRaises does not implement it but many occurences are found in Odoo tests. Odoo developpers usually expect the same signature as found in the unittest documentation. This commit implements the `msg` parameter in a similar way as unittest. [1] https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertRaises -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr