def test_mode(): assert GPIO.getmode() is None GPIO.setmode(GPIO.BCM) assert GPIO.getmode() == GPIO.BCM GPIO.cleanup() assert GPIO.getmode() is None with pytest.raises(AssertionError): GPIO.setmode("Sausages")
def setup(): with patch("LPi.GPIO.sysfs"): GPIO.cleanup()