TST Handle Connection error in test_load_boston_alternative
@@ -341,7 +341,10 @@ def test_load_boston_alternative():
boston_sklearn = load_boston()
data_url = "http://lib.stat.cmu.edu/datasets/boston"
+ try:
raw_df = pd.read_csv(data_url, sep=r"\s+", skiprows=22, header=None)
+ except ConnectionError as e:
+ pytest.xfail(f"The dataset can't be downloaded. Got exception: {e}")
data = np.hstack([raw_df.values[::2, :], raw_df.values[1::2, :2]])
target = raw_df.values[1::2, 2]
