def test_consistent_length():
    """Test that a ValueError is raised with a constant sample."""
    msg_error = (
        "The number of timestamps in X must be the same as "
        "the number of timestamps when `fit` was called "
        "({0} != {1}).".format(3, 1)
    )
    mcb = MultipleCoefficientBinning()
    mcb.fit(X, y)
    with pytest.raises(ValueError, match=re.escape(msg_error)):
        mcb.transform(X[:, :1])
Test that a ValueError is raised with a constant sample.
pyts/approximation/tests/test_mcb.py