-
-
Notifications
You must be signed in to change notification settings - Fork 62
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 bug on sourced percentage, add test #78
Conversation
👍 when travis green ! Thanks |
Red because of lint. I'm fixing it. |
lint fixed |
if req.state != 'cancel') | ||
sourced_len = sum(1 for req in requisition.line_ids | ||
sourced_len = sum(1.0 for req in requisition.line_ids |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the record, adding from __future__ import division
at the beginning of the file is a nicer way of fixing this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, right
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't knew that one... thanks !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and you can use the // operator if you still want integer division.
@gurneyalex welcome to the future. |
Because of a integer division error, with one sourced line out of two, the sourcing percentage was zero instead of 0.5. Added a test to check this case.
2c855be
to
a6a83e6
Compare
👍 |
👍 Very nice: one line change and he still adds tests 👏 |
👍 |
fix bug on sourced percentage, add test
Hmm. It got red once merged 😠 |
We're having some flickering tests runs here and there, and I haven't investigated the reason. If someone finds out what's going on please make some noise! |
I found out that this is not flickering at all, instead there is a genuine mistake of mine in this PR that we all didn't see because of the false negatives we had 2 weeks ago with MQT. These problems are fixed now, so we made the whole vertical-ngo/8.0 branch red. I'm preparing a PR to sort that out and I'll ask reviewers to fast-track it. |
Fixed in #93 |
Because of a integer division error, with one sourced line out of two,
the sourcing percentage was zero instead of 0.5. Added a test to check
this case.