def test_issues_warning_if_interrupt_enabled_when_pin_is_in_immediate_read_mode(b, p):
    with chip[b][p] as pin:
        pin.bank.read_mode = immediate_read
        
        with catch_warnings(record=True) as warnings:
            issue_warnings(u"always")
            
            pin.enable_interrupts(value=1)
            
            assert len(warnings) > 0
def test_issues_warning_if_interrupt_enabled_when_pin_is_in_immediate_read_mode(
        b, p):
    with chip[b][p] as pin:
        pin.bank.read_mode = immediate_read

        with catch_warnings(record=True) as warnings:
            issue_warnings(u"always")

            pin.enable_interrupts(value=1)

            assert len(warnings) > 0
def test_issues_no_warning_if_interrupt_enabled_when_pin_is_in_deferred_read_mode(b, p):
    with chip[b][p] as pin:
        pin.bank.read_mode = deferred_read
        
        with catch_warnings(record=True) as warnings:
            issue_warnings(u"always")
            
            pin.enable_interrupts()
            
            print warnings
            assert len(warnings) == 0
def test_issues_no_warning_if_interrupt_enabled_when_pin_is_in_deferred_read_mode(
        b, p):
    with chip[b][p] as pin:
        pin.bank.read_mode = deferred_read

        with catch_warnings(record=True) as warnings:
            issue_warnings(u"always")

            pin.enable_interrupts()

            print warnings
            assert len(warnings) == 0
def test_issues_no_warning_if_interrupt_enabled_when_pin_is_in_custom_read_mode(b, p):
    def custom_read_mode(f):
        pass
    
    with chip[b][p] as pin:
        pin.bank.read_mode = custom_read_mode
        
        with catch_warnings(record=True) as warnings:
            issue_warnings(u"always")
            
            pin.enable_interrupts()
            
            assert len(warnings) == 0
def test_issues_no_warning_if_interrupt_enabled_when_pin_is_in_custom_read_mode(
        b, p):
    def custom_read_mode(f):
        pass

    with chip[b][p] as pin:
        pin.bank.read_mode = custom_read_mode

        with catch_warnings(record=True) as warnings:
            issue_warnings(u"always")

            pin.enable_interrupts()

            assert len(warnings) == 0