Skip to content
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

[FIX] sale_stock: fix msg argument in assertion #25831

Merged

Conversation

ap-wtioit
Copy link
Contributor

Description of the issue/feature this PR addresses:
third positional argument of assertAlmostEqual is places not msg (which expects a number not a str)
https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertAlmostEqual
if assertion fails we get an error like this (and not the intended message):

 if round(abs(second-first), places) == 0:
 TypeError: 'str' object cannot be interpreted as an integer

Current behavior before PR:

  • When assertAlmostEquals fails in sale_stock_test it gives a weird Type error

Desired behavior after PR is merged:

  • When assertAlmostEquals fails in sale_stock_test it gives the intended message

Introduced in e441f34

Info @wt-io-it

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

third positional argument is places not msg (which expects a number not a str)
https://docs.python.org/2/library/unittest.html#unittest.TestCase.assertAlmostEqual

fixes errors like these:
 if round(abs(second-first), places) == 0:
 TypeError: 'str' object cannot be interpreted as an integer

and gives the intended message when assertion is errornous
@wtaferner
Copy link
Contributor

@nim-odoo
May I ask you to merge this?

@nim-odoo nim-odoo self-assigned this Aug 3, 2018
@nim-odoo nim-odoo merged commit b3bcfbd into odoo:11.0 Aug 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants