(self)
| 1107 | ) |
| 1108 | |
| 1109 | def test_constructor_with_iterable_argument(self): |
| 1110 | a = array.array(self.typecode, iter(self.example)) |
| 1111 | b = array.array(self.typecode, self.example) |
| 1112 | self.assertEqual(a, b) |
| 1113 | |
| 1114 | # non-iterable argument |
| 1115 | self.assertRaises(TypeError, array.array, self.typecode, 10) |
| 1116 | |
| 1117 | # pass through errors raised in __iter__ |
| 1118 | class A: |
| 1119 | def __iter__(self): |
| 1120 | raise UnicodeError |
| 1121 | self.assertRaises(UnicodeError, array.array, self.typecode, A()) |
| 1122 | |
| 1123 | # pass through errors raised in next() |
| 1124 | def B(): |
| 1125 | raise UnicodeError |
| 1126 | yield None |
| 1127 | self.assertRaises(UnicodeError, array.array, self.typecode, B()) |
| 1128 | |
| 1129 | def test_coveritertraverse(self): |
| 1130 | try: |
nothing calls this directly
no test coverage detected