(self)
| 1090 | assert_equal(len(a), 0) |
| 1091 | |
| 1092 | def test_false_len_iterable(self): |
| 1093 | # Special case where a bad __getitem__ makes us fall back on __iter__: |
| 1094 | class C: |
| 1095 | def __getitem__(self, x): |
| 1096 | raise Exception |
| 1097 | def __iter__(self): |
| 1098 | return iter(()) |
| 1099 | def __len__(self): |
| 1100 | return 2 |
| 1101 | |
| 1102 | a = np.empty(2) |
| 1103 | with assert_raises(ValueError): |
| 1104 | a[:] = C() # Segfault! |
| 1105 | |
| 1106 | np.array(C()) == list(C()) |
| 1107 | |
| 1108 | def test_failed_len_sequence(self): |
| 1109 | # gh-7393 |
nothing calls this directly
no test coverage detected