(self)
| 232 | assert "\t" not in tabs |
| 233 | |
| 234 | def test_index_repr(self) -> None: |
| 235 | coord_names = ("x", "y") |
| 236 | index = CustomIndex(coord_names) |
| 237 | names = ("x",) |
| 238 | |
| 239 | normal = formatting.summarize_index(names, index, col_width=20) |
| 240 | assert names[0] in normal |
| 241 | assert len(normal.splitlines()) == len(names) |
| 242 | assert "CustomIndex" in normal |
| 243 | |
| 244 | class IndexWithInlineRepr(CustomIndex): |
| 245 | def _repr_inline_(self, max_width: int): |
| 246 | return f"CustomIndex[{', '.join(self.names)}]" |
| 247 | |
| 248 | index = IndexWithInlineRepr(coord_names) |
| 249 | inline = formatting.summarize_index(names, index, col_width=20) |
| 250 | assert names[0] in inline |
| 251 | assert index._repr_inline_(max_width=40) in inline |
| 252 | |
| 253 | @pytest.mark.parametrize( |
| 254 | "names", |
nothing calls this directly
no test coverage detected