def test_intspansproduct_errors():
    """Check instanciation errors of IntspansProduct."""
    with pytest.raises(TypeError) as excinfo:
        IntspansProduct('4-9,10', 'a')
    assert str(excinfo.value) == 'elt_nb must be an int, found '\
        '<class \'str\'> instead.'
    with pytest.raises(TypeError) as excinfo:
        IntspansProduct(10, 3)
    assert str(excinfo.value) == 'cartesianpower_spans must be a str, found '\
        '<class \'int\'> instead.'
    with pytest.raises(RuntimeError) as excinfo:
        IntspansProduct('1×2×3', 4)
    assert str(excinfo.value) == 'Found 3 elements in this spans product: '\
        '1×2×3, but 4 were expected.'
    with pytest.raises(ValueError) as excinfo:
        IntspansProduct('1×2×a')
    assert str(excinfo.value) == 'Syntax error found in this integers\' '\
        'span: a, what should complain with intspan syntax. See '\
        'http://intspan.readthedocs.io/en/latest/index.html'