Skip to content

Commit de99ca8

Browse files
FrancescAltedclaude
andcommitted
Keep test names under 50 characters
346 of 7164 defs were over 50 chars, every one of them a test -- the longest shipped name is 46. The names had become failure messages, spelling out the whole test matrix in the identifier. Trimmed the redundancy first (a prefix echoing the module, "column" for "col", "expression" for "expr"), then the trailing clause where it only restated the assertion. Where a rename dropped something the body does not otherwise say -- "when threads forced", "and honors explicit cparams" -- it moved into a one-line docstring rather than vanishing. Also collapsed the four test_batcharray_guess_items_per_block_uses_* tests into one parametrized test: they were a parametrize table written out longhand, four functions differing only in clevel and payload size. Test count is unchanged (7922 collected before and after). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 7a322dd commit de99ca8

54 files changed

Lines changed: 374 additions & 373 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎tests/b2view/test_cli.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ def test_download_skipped_when_file_already_in_cwd():
3939
assert info_url is None
4040

4141

42-
def test_download_urls_keep_relative_path_dest_is_basename():
42+
def test_download_url_dest_is_basename():
4343
urlpath, url, info_url = resolve_source(None, "sub/dir/bundle.b2z", exists=lambda p: False)
4444
assert urlpath == "bundle.b2z"
4545
assert url == DOWNLOAD_BASE_URL + "sub/dir/bundle.b2z"
4646
assert info_url == INFO_BASE_URL + "sub/dir/bundle.b2z"
4747

4848

49-
def test_download_and_positional_are_mutually_exclusive():
49+
def test_download_and_positional_exclusive():
5050
with pytest.raises(ValueError, match="cannot be combined"):
5151
resolve_source("local.b2z", "foo.b2z")
5252

‎tests/b2view/test_group.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def test_group_sort_noop_when_not_grouped(group_store):
169169
assert browser.get_group_sort("/ctable") is None
170170

171171

172-
def test_group_bars_categorical_is_bar_sorted_desc_and_capped(group_store):
172+
def test_group_bars_categorical_sorted_and_capped(group_store):
173173
"""A dictionary key yields capped bars ranked by the aggregate descending."""
174174
path, _ = group_store
175175
with StoreBrowser(path) as browser:
@@ -195,7 +195,7 @@ def test_group_bars_numeric_is_line_pareto_by_default(group_store):
195195
assert "rank" in bars["xlabel"]
196196

197197

198-
def test_group_bars_numeric_sorted_by_key_uses_key_on_x(group_store):
198+
def test_group_bars_numeric_sorted_by_key(group_store):
199199
"""Sorting a numeric-key result by the key puts key values on X in that order."""
200200
path, _ = group_store
201201
with StoreBrowser(path) as browser:

‎tests/b2view/test_plot_model.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def test_stream_envelope_matches_full_read_ctable(plot_store, monkeypatch):
9999
_assert_exact(env, vals)
100100

101101

102-
def test_stream_envelope_captures_spike_a_sample_would_miss(plot_store, monkeypatch):
102+
def test_stream_envelope_captures_spike(plot_store, monkeypatch):
103103
path, vals = plot_store
104104
_force_stream(monkeypatch)
105105
with StoreBrowser(path) as browser:
@@ -222,7 +222,7 @@ def test_read_series_clamps_range(plot_store):
222222
assert clamped["y"].shape == (N,)
223223

224224

225-
def test_locked_row_window_confines_plot_and_read_series(plot_store):
225+
def test_locked_row_window_confines_plot(plot_store):
226226
"""A locked row window (the 'v' action) takes precedence over the full
227227
series in both plot_series and read_series, matching preview()/read_cell()
228228
(PR #663 review): a plot/hi-res of a windowed CTable shows only its rows."""

‎tests/b2view/test_sort.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ async def _wait_for_table(pilot) -> None:
185185

186186
@pytest.mark.asyncio
187187
@pytest.mark.tui
188-
async def test_sort_key_opens_screen_applies_and_escape_clears(sort_store):
188+
async def test_sort_key_applies_and_escape_clears(sort_store):
189189
path, _, _ = sort_store
190190
app = B2ViewApp(path, start_panel="data")
191191
async with app.run_test(size=TERM_SIZE) as pilot:

‎tests/ctable/test_arrow_interop.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ def test_from_arrow_string_fixed_width_with_max_length():
351351
assert t["name"][:].tolist() == ["hi", "hello world", "!"]
352352

353353

354-
def test_from_arrow_list_struct_nullable_values_roundtrip():
354+
def test_from_arrow_list_struct_nullable():
355355
nutrient_type = pa.struct(
356356
[
357357
pa.field("name", pa.string()),
@@ -454,7 +454,7 @@ def test_from_arrow_dictionary_codes_use_aligned_grid():
454454
assert list(t["c"][:5]) == c.to_pylist()[:5]
455455

456456

457-
def test_to_arrow_dictionary_multi_batch_with_deletions():
457+
def test_to_arrow_dict_multi_batch_deletions():
458458
"""Dictionary-column export across several batches, with holes in the
459459
live-row mask from a deletion, still maps each batch to the correct
460460
physical positions.

‎tests/ctable/test_column.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ def test_sum_empty_filtered_view_returns_zero():
439439
assert t[t.id < 0]["id"].sum() == 0
440440

441441

442-
def test_sum_where_skips_valid_rows_mask_when_all_rows_visible():
442+
def test_sum_where_skips_mask_when_all_visible():
443443
t = CTable(Row, new_data=DATA20, expected_size=len(DATA20))
444444
mask = t["id"]._lazy_nonnull_mask(where=t["score"] < 100)
445445
assert mask.expression == "(o0 < 100)"
@@ -904,7 +904,7 @@ def test_column_repr_shows_preview_values():
904904
assert "..." in r
905905

906906

907-
def test_info_omits_capacity_and_read_only_for_in_memory_table():
907+
def test_info_omits_capacity_for_in_memory():
908908
t = CTable(Row, new_data=DATA20)
909909
info = repr(t.info)
910910
assert "capacity" not in info
@@ -1077,7 +1077,7 @@ def test_ctable_setitem_view_raises():
10771077
view["score"] = np.zeros(len(view))
10781078

10791079

1080-
def test_column_setitem_ndarray_fast_path_on_disk_table(tmp_path):
1080+
def test_setitem_ndarray_fast_path_on_disk(tmp_path):
10811081
"""Fast path fires for a disk-opened table (not just freshly-built in-memory tables)."""
10821082
n = 60
10831083
urlpath = str(tmp_path / "tbl.b2")
@@ -1113,7 +1113,7 @@ class R:
11131113
np.testing.assert_allclose(t["val"][:], np.arange(n, dtype=np.float64) * 3.14)
11141114

11151115

1116-
def test_column_setitem_blosc2_ndarray_no_holes_uneven_chunks():
1116+
def test_setitem_b2_ndarray_no_holes_uneven():
11171117
"""Fast path works when nrows is not a multiple of chunk_size."""
11181118
n = 70
11191119

‎tests/ctable/test_column_ndarray_like.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def test_column_logical_metadata():
2626
assert view.x.size == 3
2727

2828

29-
def test_column_boolean_operators_build_lazy_expressions():
29+
def test_boolean_operators_build_lazy_exprs():
3030
t = blosc2.CTable(Row, new_data=DATA)
3131

3232
view = t.where(t.flag & (t.x > 0))

‎tests/ctable/test_column_slice_fastpath.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def test_deletions_use_position_path_and_stay_correct(key):
148148

149149

150150
@pytest.mark.parametrize("key", [np.s_[::5], np.s_[::-2], np.s_[::-1]])
151-
def test_filtered_view_uses_position_path_and_stays_correct(key):
151+
def test_filtered_view_uses_position_path(key):
152152
table, arr = _make()
153153
view = table.where("a >= 500")
154154
expected = arr["b"][arr["a"] >= 500]

‎tests/ctable/test_csv_interop.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ def test_from_csv_ndarray_wrong_shape_raises(tmp_csv):
356356
CTable.from_csv(tmp_csv, NdarrayRow)
357357

358358

359-
def test_from_csv_nonnullable_ndarray_empty_cell_raises(tmp_csv):
359+
def test_csv_nonnullable_empty_cell_raises(tmp_csv):
360360
with open(tmp_csv, "w") as f:
361361
f.write("id,embedding\n")
362362
f.write("1,\n")

‎tests/ctable/test_ctable_computed_cols.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def test_computed_column_where_via_col():
164164
assert len(view) == 3 # 9, 16, 25
165165

166166

167-
def test_getitem_boolean_lazyexpr_matches_where_for_computed_column():
167+
def test_getitem_bool_lazyexpr_matches_where():
168168
t = _make_invoice_table(5)
169169
t.add_computed_column("total", lambda cols: cols["price"] * cols["qty"])
170170
expr = t.total >= 9
@@ -499,7 +499,7 @@ def test_materialize_computed_column_extend_autofill():
499499
np.testing.assert_allclose(t["total_stored"][:], [1.0, 4.0, 9.0, 16.0])
500500

501501

502-
def test_materialize_computed_column_explicit_append_value_wins():
502+
def test_materialize_explicit_append_wins():
503503
t = _make_invoice_table(2)
504504
t.add_computed_column("total", lambda cols: cols["price"] * cols["qty"])
505505
t.materialize_computed_column("total", new_name="total_stored")
@@ -745,7 +745,7 @@ def test_materialize_computed_column_open_roundtrip(tmp_path):
745745
assert t2.index("total_stored").kind == "full"
746746

747747

748-
def test_materialize_computed_column_open_append_autofill(tmp_path):
748+
def test_materialize_open_append_autofill(tmp_path):
749749
path = str(tmp_path / "tbl")
750750
t = CTable(Invoice, [(1.0, 1, 0.1), (2.0, 2, 0.1)], urlpath=path, mode="w")
751751
t.add_computed_column("total", lambda cols: cols["price"] * cols["qty"])
@@ -1066,7 +1066,7 @@ def patched(self, expr):
10661066
t.add_computed_column("total", lambda cols: cols["price"] * cols["qty"])
10671067

10681068

1069-
def test_add_computed_column_malformed_expression_raises(monkeypatch):
1069+
def test_add_computed_malformed_expr_raises(monkeypatch):
10701070
"""add_computed_column raises ValueError when the expression string cannot be re-parsed."""
10711071
t = _make_invoice_table()
10721072

0 commit comments

Comments
 (0)