Skip to content

Commit 5d46cb3

Browse files
committed
Fix typo in gpio tests
1 parent 01a379a commit 5d46cb3

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

chipflow_digital_ip/io/_gpio.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ class GPIOPeripheral(wiring.Component):
3838
Raises
3939
------
4040
:exc:`TypeError`
41-
If ``pin_count`` is not a positive integer.
42-
:exc:`TypeError`
43-
If ``input_stages`` is not a non-negative integer.
41+
If ``pin_count`` is not an integer.
42+
:exc:`ValueError`
43+
If ``pin_count`` is not in the supported range
4444
"""
4545

4646
def __init__(self, *, pin_count, addr_width=4, data_width=8, input_stages=2):
@@ -49,7 +49,7 @@ def __init__(self, *, pin_count, addr_width=4, data_width=8, input_stages=2):
4949

5050
if pin_count > 32 or pin_count <= 0:
5151
# TODO: why?
52-
raise ValueError(f"Pin pin_count must be a postive integrer less than 32, not {pin_count}")
52+
raise ValueError(f"Pin pin_count must be a positive integer 32 or less, not {pin_count}")
5353

5454
self._gpio = gpio.Peripheral(pin_count=pin_count,
5555
addr_width=addr_width,

tests/test_gpio.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,15 @@ def test_init_wrong_pin_count(self):
3030
r"Pin count must be a positive integer, not foo"):
3131
GPIOPeripheral(pin_count="foo", addr_width=2, data_width=8)
3232
with self.assertRaisesRegex(ValueError,
33-
r"Pin pin_count must be a postive integrer less than 32, not -1"):
33+
r"Pin pin_count must be a positive integer 32 or less, not -1"):
3434
GPIOPeripheral(pin_count=-1, addr_width=2, data_width=8)
3535
with self.assertRaisesRegex(ValueError,
36-
r"Pin pin_count must be a postive integrer less than 32, not 0"):
36+
r"Pin pin_count must be a positive integer 32 or less, not 0"):
3737
GPIOPeripheral(pin_count=0, addr_width=2, data_width=8)
3838
with self.assertRaisesRegex(ValueError,
39-
r"Pin pin_count must be a postive integrer less than 32, not 33"):
39+
r"Pin pin_count must be a positive integer 32 or less, not 33"):
4040
GPIOPeripheral(pin_count=33, addr_width=2, data_width=8)
4141

42-
4342
def test_init_wrong_input_stages(self):
4443
with self.assertRaisesRegex(TypeError,
4544
r"Input stages must be a non-negative integer, not 'foo'"):

0 commit comments

Comments
 (0)