Skip to content

Commit e8f175d

Browse files
committed
Remove unnecessary FixedList.serialize() method
1 parent 58bd772 commit e8f175d

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

tests/test_types_basic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ def test_fixed_list():
126126
class TestList(t.FixedList, item_type=t.uint16_t, length=3):
127127
pass
128128

129-
with pytest.raises(AssertionError):
129+
with pytest.raises(ValueError):
130130
r = TestList([1, 2, 3, 0x55AA])
131131
r.serialize()
132132

133-
with pytest.raises(AssertionError):
133+
with pytest.raises(ValueError):
134134
r = TestList([1, 2])
135135
r.serialize()
136136

zigpy_znp/types/basic.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,6 @@ def __init_subclass__(cls, *, item_type, length) -> None:
171171
cls._item_type = item_type
172172
cls._length = length
173173

174-
def serialize(self) -> bytes:
175-
assert len(self) == self._length
176-
return super().serialize()
177-
178174
@classmethod
179175
def deserialize(cls, data):
180176
assert cls._item_type is not None

0 commit comments

Comments
 (0)