diff --git a/tests/test_tables.py b/tests/test_tables.py index 17c3dc56..453e4ca8 100644 --- a/tests/test_tables.py +++ b/tests/test_tables.py @@ -1996,6 +1996,20 @@ def test_num_columns(table): number = table.num_columns assert number == 3 +def test_split(table): + """Test that split copies over the _formats variable from the original table to the new tables correctly after splitting""" + + #defined a custom formatter for points column + def positive_point_formatter(value): + return f"+{value}" + + table.set_format("points", positive_point_formatter) + + t1, t2 = table.split(2) + + assert t1._formats == table._formats + assert t2._formats == table._formats + def test_with_columns(table): """Test that with_columns returns self if no labels_and_values passed""" t = table.with_columns()