Repository navigation
Replies: 1 comment
|
Checked this and I agree, it smells bad In an assertion the expected value is the reference, so "within 100%" should be measured against it, as Will change this with next minor version Right now you can use something like this |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
relatively_within docstring provides:
I understand math.isclose behaviour because there's no different semantic for both arguments, but when one is an expected/reference one, I think pytest behaviour is more intuitive. Otherwise, this assertion passes
assert_that(10).is_close_to(1, rel=1)where I wanted to express the value to be 100% away from the expected value
All reactions