Skip to content

Commit 9b5faba

Browse files
committed
pandas._testing -> pandas.util.libtesting
1 parent f9dcad7 commit 9b5faba

File tree

4 files changed

+19
-18
lines changed

4 files changed

+19
-18
lines changed

doc/source/whatsnew/v0.20.0.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -448,10 +448,10 @@ New Behavior:
448448

449449
.. _whatsnew_0200.api_breaking.extensions:
450450

451-
Extension Modules Moving
452-
^^^^^^^^^^^^^^^^^^^^^^^^
451+
Extension Modules Moved
452+
^^^^^^^^^^^^^^^^^^^^^^^
453453

454-
Some formerly public extension modules have been moved and/or renamed. These are all removed from the public API.
454+
Some formerly public c/c++/cython extension modules have been moved and/or renamed. These are all removed from the public API.
455455
If indicated, a deprecation warning will be issued if you reference that module. (:issue:`12588`)
456456

457457
.. csv-table::
@@ -462,6 +462,7 @@ If indicated, a deprecation warning will be issued if you reference that module.
462462
"pandas.parser", "pandas.io.libparsers", "X"
463463
"pandas.io.sas.saslib", "pandas.io.sas.libsas", ""
464464
"pandas.msgpack", "pandas.io.msgpack", ""
465+
"pandas._testing", "pandas.util.libtesting", ""
465466

466467

467468
.. _whatsnew_0200.api_breaking.groupby_describe:

pandas/util/testing.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
TimedeltaIndex, PeriodIndex, RangeIndex, Index, MultiIndex,
4848
Series, DataFrame, Panel, Panel4D)
4949
from pandas.util.decorators import deprecate
50-
from pandas import _testing
50+
from pandas.util import libtesting
5151
from pandas.io.common import urlopen
5252
slow = pytest.mark.slow
5353

@@ -173,7 +173,7 @@ def assert_almost_equal(left, right, check_exact=False,
173173
else:
174174
obj = 'Input'
175175
assert_class_equal(left, right, obj=obj)
176-
return _testing.assert_almost_equal(
176+
return libtesting.assert_almost_equal(
177177
left, right,
178178
check_dtype=check_dtype,
179179
check_less_precise=check_less_precise,
@@ -185,7 +185,7 @@ def assert_dict_equal(left, right, compare_keys=True):
185185
assertIsInstance(left, dict, '[dict] ')
186186
assertIsInstance(right, dict, '[dict] ')
187187

188-
return _testing.assert_dict_equal(left, right, compare_keys=compare_keys)
188+
return libtesting.assert_dict_equal(left, right, compare_keys=compare_keys)
189189

190190

191191
def randbool(size=(), p=0.5):
@@ -814,10 +814,10 @@ def _get_ilevel_values(index, level):
814814
.format(obj, np.round(diff, 5))
815815
raise_assert_detail(obj, msg, left, right)
816816
else:
817-
_testing.assert_almost_equal(left.values, right.values,
818-
check_less_precise=check_less_precise,
819-
check_dtype=exact,
820-
obj=obj, lobj=left, robj=right)
817+
libtesting.assert_almost_equal(left.values, right.values,
818+
check_less_precise=check_less_precise,
819+
check_dtype=exact,
820+
obj=obj, lobj=left, robj=right)
821821

822822
# metadata comparison
823823
if check_names:
@@ -1194,10 +1194,10 @@ def assert_series_equal(left, right, check_dtype=True,
11941194
assert_numpy_array_equal(left.get_values(), right.get_values(),
11951195
check_dtype=check_dtype)
11961196
else:
1197-
_testing.assert_almost_equal(left.get_values(), right.get_values(),
1198-
check_less_precise=check_less_precise,
1199-
check_dtype=check_dtype,
1200-
obj='{0}'.format(obj))
1197+
libtesting.assert_almost_equal(left.get_values(), right.get_values(),
1198+
check_less_precise=check_less_precise,
1199+
check_dtype=check_dtype,
1200+
obj='{0}'.format(obj))
12011201

12021202
# metadata comparison
12031203
if check_names:
File renamed without changes.

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ class CheckSDist(sdist_class):
336336
'pandas/io/parsers.pyx',
337337
'pandas/src/period.pyx',
338338
'pandas/src/sparse.pyx',
339-
'pandas/src/testing.pyx',
339+
'pandas/util/testing.pyx',
340340
'pandas/src/hash.pyx',
341341
'pandas/io/sas/sas.pyx']
342342

@@ -511,9 +511,9 @@ def pxd(name):
511511
'pandas/src/parser/io.c']},
512512
'_sparse': {'pyxfile': 'src/sparse',
513513
'depends': ([srcpath('sparse', suffix='.pyx')] +
514-
_pxi_dep['_sparse'])},
515-
'_testing': {'pyxfile': 'src/testing',
516-
'depends': [srcpath('testing', suffix='.pyx')]},
514+
_pxi_dep['sparse'])},
515+
'util.libtesting': {'pyxfile': 'util/testing',
516+
'depends': ['pandas/util/testing.pyx']},
517517
'_hash': {'pyxfile': 'src/hash',
518518
'depends': [srcpath('hash', suffix='.pyx')]},
519519
'io.sas.libsas': {'pyxfile': 'io/sas/sas'},

0 commit comments

Comments
 (0)