Skip to content

Commit 5390351

Browse files
jbrockmendelJulianWgs
authored andcommitted
TYP: testing.pyi (pandas-dev#40594)
1 parent 109ce0c commit 5390351

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

pandas/_libs/testing.pyi

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
3+
def assert_dict_equal(a, b, compare_keys: bool = ...): ...
4+
5+
def assert_almost_equal(a, b,
6+
rtol: float = ..., atol: float = ...,
7+
check_dtype: bool = ...,
8+
obj=..., lobj=..., robj=..., index_values=...): ...

pandas/_testing/asserters.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ def assert_almost_equal(
154154
else:
155155
obj = "Input"
156156
assert_class_equal(left, right, obj=obj)
157+
158+
# if we have "equiv", this becomes True
159+
check_dtype = bool(check_dtype)
157160
_testing.assert_almost_equal(
158161
left, right, check_dtype=check_dtype, rtol=rtol, atol=atol, **kwargs
159162
)
@@ -388,12 +391,15 @@ def _get_ilevel_values(index, level):
388391
msg = f"{obj} values are different ({np.round(diff, 5)} %)"
389392
raise_assert_detail(obj, msg, left, right)
390393
else:
394+
395+
# if we have "equiv", this becomes True
396+
exact_bool = bool(exact)
391397
_testing.assert_almost_equal(
392398
left.values,
393399
right.values,
394400
rtol=rtol,
395401
atol=atol,
396-
check_dtype=exact,
402+
check_dtype=exact_bool,
397403
obj=obj,
398404
lobj=left,
399405
robj=right,

0 commit comments

Comments
 (0)