diff --git a/tests/test_tables.py b/tests/test_tables.py index 453e4ca8..c866bdc0 100644 --- a/tests/test_tables.py +++ b/tests/test_tables.py @@ -1996,6 +1996,12 @@ def test_num_columns(table): number = table.num_columns assert number == 3 +def test_as_label(table): + """Test that as_label raises ValueError for invalid index_or_label along with correct message""" + + with pytest.raises(ValueError) as t: + table.set_format(None, CurrencyFormatter(int_to_float=True)) + assert str(t.value) == "None is not a label or index" def test_split(table): """Test that split copies over the _formats variable from the original table to the new tables correctly after splitting"""