コード例 #1
0
def test_suppressor_generator_suppress():
    with pytest.raises(IndexError):
        with task02.Suppressor(AttributeError):
            [0][1]
コード例 #2
0
def test_suppressor_class_inheritance_wrong(MyTestExp):
    with pytest.raises(IndexError):
        with task02.Suppressor(MyTestExp):
            assert [0][1]
コード例 #3
0
def test_suppressor_class_wrong_exception():
    with pytest.raises(IndexError):
        with task02.Suppressor(AttributeError):
            [0][1]
コード例 #4
0
def test_suppressor_class_suppress_inheritance(MyTestExp):
    with task02.Suppressor(MyTestExp):
        assert 1 / 0
コード例 #5
0
def test_suppressor_class_suppress():
    with task02.Suppressor(IndexError):
        assert [0][1]