[lang-ref] ( handle_exception ) ( python )

def test_handle_exception():
    # pytest.raises
    with pytest.raises(ValueError):
        raise ValueError()
@pytest.mark.xfail(raises=ValueError, reason='Expected error')
def test_handle_exception_alternative():
    # @pytest.mark.xfail
    raise ValueError()