def test_removes_infinite_values():
df = mtcars.copy()
df.loc[[0, 5], 'wt'] = [np.inf, -np.inf]
p = ggplot(df, aes(x='wt')) + geom_bar()
with pytest.warns(UserWarning) as record:
p._build()
def removed_2_row_with_infinites(record):
for item in record:
msg = str(item.message).lower()
if '2 rows' in msg and 'non-finite' in msg:
return True
return False
assert removed_2_row_with_infinites(record)
评论列表
文章目录