TST use assert_warns and modernise test for constant predictor