def test_simple_chain_exception():
    """Test simple chain of excepiton."""

    try:
        raise ValueError()
    except ValueError as err:
        assert check_exception_chain(err, ValueError)
def test_list_nested_chain_exception_not():
    """Test list nested chain of excepiton."""

    try:
        try:
            raise ValueError()
        except ValueError as err:
            raise KeyError() from err
    except KeyError as err:
        assert not check_exception_chain(err, (AssertionError, OSError))
def test_simple_nested_chain_exception():
    """Test simple nested chain of excepiton."""

    try:
        try:
            raise ValueError()
        except ValueError as err:
            raise KeyError() from err
    except KeyError as err:
        assert check_exception_chain(err, ValueError)