/usr/local/lib64/python3.6/site-packages/pandas/tests/indexes
NameSizeModeActions
base_class/-0755rm
categorical/-0755rm
datetimes/-0755rm
interval/-0755rm
multi/-0755rm
numeric/-0755rm
period/-0755rm
ranges/-0755rm
timedeltas/-0755rm
__pycache__/-0755rm
common.py320270644editdlrm
conftest.py7260644editdlrm
datetimelike.py32590644editdlrm
test_any_index.py23750644editdlrm
test_base.py931260644editdlrm
test_common.py144530644editdlrm
test_engines.py86560644editdlrm
test_frozen.py30690644editdlrm
test_indexing.py28560644editdlrm
test_index_new.py41170644editdlrm
test_numeric.py229820644editdlrm
test_numpy_compat.py33620644editdlrm
test_setops.py36080644editdlrm
__init__.py00644editdlrm
Edit: /usr/local/lib64/python3.6/site-packages/pandas/tests/indexes/test_any_index.py (2375B)
""" Tests that can be parametrized over _any_ Index object. TODO: consider using hypothesis for these. """ import pytest import pandas._testing as tm def test_boolean_context_compat(index): with pytest.raises(ValueError, match="The truth value of a"): if index: pass def test_sort(index): msg = "cannot sort an Index object in-place, use sort_values instead" with pytest.raises(TypeError, match=msg): index.sort() def test_hash_error(index): with pytest.raises(TypeError, match=f"unhashable type: '{type(index).__name__}'"): hash(index) def test_mutability(index): if not len(index): return msg = "Index does not support mutable operations" with pytest.raises(TypeError, match=msg): index[0] = index[0] def test_wrong_number_names(index): names = index.nlevels * ["apple", "banana", "carrot"] with pytest.raises(ValueError, match="^Length"): index.names = names class TestConversion: def test_to_series(self, index): # assert that we are creating a copy of the index ser = index.to_series() assert ser.values is not index.values assert ser.index is not index assert ser.name == index.name def test_to_series_with_arguments(self, index): # GH#18699 # index kwarg ser = index.to_series(index=index) assert ser.values is not index.values assert ser.index is index assert ser.name == index.name # name kwarg ser = index.to_series(name="__test") assert ser.values is not index.values assert ser.index is not index assert ser.name != index.name def test_tolist_matches_list(self, index): assert index.tolist() == list(index) class TestRoundTrips: def test_pickle_roundtrip(self, index): result = tm.round_trip_pickle(index) tm.assert_index_equal(result, index) if result.nlevels > 1: # GH#8367 round-trip with timezone assert index.equal_levels(result) class TestIndexing: def test_slice_keeps_name(self, index): assert index.name == index[1:].name class TestRendering: def test_str(self, index): # test the string repr index.name = "foo" assert "'foo'" in str(index) assert type(index).__name__ in str(index)