Zirconium (Zr) Plugin¶
The Zirconium plugin provides GPIO monitoring and control capabilities.
Quick Start¶
@pytest.mark.zr
def test_gpio_monitoring(zr, check):
# Monitor GPIO state changes
check.that(zr.gpio.heartbeat, "=", True, within_duration_s=2.0)
check.that(zr.gpio.heartbeat, "=", False, within_duration_s=2.0)
GPIO Access¶
Reading GPIO States¶
# Monitor GPIO changes
check.that(zr.gpio.heartbeat, "=", True, within_duration_s=2.0)
Writing GPIO States¶
# Set GPIO state (only for output GPIOs)
zr.gpio.heartbeat.set(True)
Using with Checker¶
The Zr plugin works seamlessly with the Checker plugin for GPIO state verification:
def test_gpio_sequence(zr, check):
# Verify GPIO toggles from True to False within 2 seconds
check.that(zr.gpio.heartbeat, "=", True, within_duration_s=2.0)
check.that(zr.gpio.heartbeat, "=", False, within_duration_s=2.0)
# Verify GPIO stays True for at least 1 second
check.that(zr.gpio.heartbeat, "=", True, for_duration_s=1.0)
API Reference¶
See zeloscloud.pytest.zr.zirconium in the API Reference.