diff options
| author | David Lechner <[email protected]> | 2026-03-12 15:33:41 -0500 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2026-03-25 14:38:15 -0600 |
| commit | 0f101dac8fb6792f981c78ccd7a284e553ce5764 (patch) | |
| tree | 7736295d6f0ac079c5a6d99741cf7d7d028e69e3 /test | |
| parent | 908db6c647ce1cf265f0bafd98578ad903c16a04 (diff) | |
test/py: gpio: allow omitting gpio_op_pin
Modify tests that make use of gpio_op_pin from env__gpio_dev_config to
be skipped if gpio_op_pin is not provided. This is useful in cases where
one might not be sure which GPIOs are safe to use as outputs that can be
toggled without causing problems.
Signed-off-by: David Lechner <[email protected]>
Diffstat (limited to 'test')
| -rw-r--r-- | test/py/tests/test_gpio.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/test/py/tests/test_gpio.py b/test/py/tests/test_gpio.py index 059b5141b0f..eba7bab7589 100644 --- a/test/py/tests/test_gpio.py +++ b/test/py/tests/test_gpio.py @@ -134,7 +134,11 @@ def test_gpio_set_generic(ubman): if not f: pytest.skip("gpio not configured") - gpio_pin_adr = f['gpio_op_pin'] + gpio_pin_adr = f.get('gpio_op_pin') + + if gpio_pin_adr is None: + pytest.skip("gpio_op_pin is not configured") + gpio_set_value = f['gpio_set_value'] @@ -158,7 +162,11 @@ def test_gpio_clear_generic(ubman): if not f: pytest.skip("gpio not configured") - gpio_pin_adr = f['gpio_op_pin'] + gpio_pin_adr = f.get('gpio_op_pin') + + if gpio_pin_adr is None: + pytest.skip("gpio_op_pin is not configured") + gpio_clear_value = f['gpio_clear_value'] @@ -182,7 +190,11 @@ def test_gpio_toggle_generic(ubman): if not f: pytest.skip("gpio not configured") - gpio_pin_adr = f['gpio_op_pin'] + gpio_pin_adr = f.get('gpio_op_pin') + + if gpio_pin_adr is None: + pytest.skip("gpio_op_pin is not configured") + gpio_set_value = f['gpio_set_value'] gpio_clear_value = f['gpio_clear_value'] |
