Check that views with unorderable items have stable sorting.
(self)
| 680 | "{1: dict_values([{...}])}") |
| 681 | |
| 682 | def test_unorderable_items_views(self): |
| 683 | """Check that views with unorderable items have stable sorting.""" |
| 684 | d = dict((((3+1j), 3), ((1+1j), (1+0j)), (1j, 0j), (500, None), (499, None))) |
| 685 | iv = ItemsView(d) |
| 686 | self.assertEqual(pprint.pformat(iv), |
| 687 | pprint.pformat(iv)) |
| 688 | self.assertTrue(pprint.pformat(iv).endswith(", 499: None, 500: None})"), |
| 689 | pprint.pformat(iv)) |
| 690 | self.assertEqual(pprint.pformat(d.items()), # Won't be equal unless _safe_tuple |
| 691 | pprint.pformat(d.items())) # is used in _safe_repr |
| 692 | self.assertTrue(pprint.pformat(d.items()).endswith(", (499, None), (500, None)])")) |
| 693 | |
| 694 | def test_mapping_view_subclass_no_mapping(self): |
| 695 | class BMV(MappingView): |
nothing calls this directly
no test coverage detected