test_pickle.py 435 B

12345678910111213
  1. import pytest
  2. from pandas import IntervalIndex
  3. import pandas._testing as tm
  4. class TestPickle:
  5. @pytest.mark.parametrize("closed", ["left", "right", "both"])
  6. def test_pickle_round_trip_closed(self, closed):
  7. # https://github.com/pandas-dev/pandas/issues/35658
  8. idx = IntervalIndex.from_tuples([(1, 2), (2, 3)], closed=closed)
  9. result = tm.round_trip_pickle(idx)
  10. tm.assert_index_equal(result, idx)