index.py 517 B

12345678910111213141516171819
  1. """
  2. Tests for Indexes backed by arbitrary ExtensionArrays.
  3. """
  4. import pandas as pd
  5. class BaseIndexTests:
  6. """Tests for Index object backed by an ExtensionArray"""
  7. def test_index_from_array(self, data):
  8. idx = pd.Index(data)
  9. assert data.dtype == idx.dtype
  10. def test_index_from_listlike_with_dtype(self, data):
  11. idx = pd.Index(data, dtype=data.dtype)
  12. assert idx.dtype == data.dtype
  13. idx = pd.Index(list(data), dtype=data.dtype)
  14. assert idx.dtype == data.dtype