-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TST/API: Simplify testing functions API #10788
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
Comments
I've seen multiple versions of 2 scattered across different test scripts, such as this. They might be good building blocks. |
Regarding the How to specify comparison tolerance, I have two problems with the current interface:
Specifically for that last point, I think it is nice to look at |
Added 3rd item, I think we should replace |
I think a lot of these have addressed in a meantime so closing |
Derived from #10507. Consider better API for testing functions.
1. How to specify comparison tolerance
Current assert functions have
check_less_precise
andcheck_exact
flags to specify how to compare values:check_exact=True
: Useassert_equal
, comparison using==
.check_exact=False
andcheck_less_precise=False
: Useassert_almost_equal
, comparing 5 digits after decimal points (default)check_exact=False
andcheck_less_precise=True
: Useassert_almost_equal
, comparing 3 digits after decimal pointsThere can be single kw to specify above behaviors?
2. Make integrated assert function
I think it's nice to have test functions which supports all
pandas
objects for users who is starting contribution / using pandas as their dependencies. ChangingassertEquals
andassertAlmostEquals
to internally use currentassert_index/series/frame_equal
is one idea.3. Remove
assert_almost_equal
Remove
assert_almost_equal
and use class-based validation method. Also add input type validation tonumpy_assert_array_equal
.xref #9895.
The text was updated successfully, but these errors were encountered: