def test_suppressor_generator_suppress(): with pytest.raises(IndexError): with task02.Suppressor(AttributeError): [0][1]
def test_suppressor_class_inheritance_wrong(MyTestExp): with pytest.raises(IndexError): with task02.Suppressor(MyTestExp): assert [0][1]
def test_suppressor_class_wrong_exception(): with pytest.raises(IndexError): with task02.Suppressor(AttributeError): [0][1]
def test_suppressor_class_suppress_inheritance(MyTestExp): with task02.Suppressor(MyTestExp): assert 1 / 0
def test_suppressor_class_suppress(): with task02.Suppressor(IndexError): assert [0][1]