def test_opens_and_closes_itself_when_used_as_a_context_manager(self):
    pin = pins.pin(0)
    with pin:
        pin.value
    with pytest.raises(IOError):
        pin.value
def test_opens_and_closes_itself_when_used_as_a_context_manager(self):
    pin = pins.pin(0)
    with pin:
        pin.value
    with pytest.raises(IOError):
        pin.value