def test_pin_must_be_opened_before_use_and_is_unusable_after_being_closed(self):
    pin = pins.pin(0)
    with pytest.raises(IOError):
        pin.value
    pin.open()
    try:
        pin.value
    finally:
        pin.close()
    with pytest.raises(IOError):
        pin.value
def test_pin_must_be_opened_before_use_and_is_unusable_after_being_closed(self):
    pin = pins.pin(0)
    with pytest.raises(IOError):
        pin.value
    pin.open()
    try:
        pin.value
    finally:
        pin.close()
    with pytest.raises(IOError):
        pin.value