From 93e6be00363ceb35412f8efd727405e5f9ebcc9f Mon Sep 17 00:00:00 2001 From: Kevin Liu Date: Sat, 24 Oct 2026 11:28:37 -0700 Subject: [PATCH 1/2] Prefer for loops over parametrized tests in AGENTS.md Each parametrized case adds per-item pytest overhead (~0.3ms measured), which slows the suite as cases accumulate. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AGENTS.md b/AGENTS.md index c13a75c396..dd5f5d42e2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -65,6 +65,7 @@ lives under `pyiceberg/`, organized by concern rather than by engine: - Bias towards adding tests to existing files, rather than creating new files. - Use existing test fixtures when possible. - We have a strong bias towards integration testing over mocks. Mocks should be avoided whenever possible and should only be used if similar, existing tests are using mocks. +- Prefer a `for` loop in a single test over `@pytest.mark.parametrize`; each parametrized case adds per-test overhead that slows the suite. Include the input in assertion messages so failures are identifiable. Use `parametrize` only when cases need different fixtures (e.g., multiple catalogs). ### Required CI and Merge Queue From 3af1a3e406fa65deee6c2d6acfcebe778590fa1d Mon Sep 17 00:00:00 2001 From: Kevin Liu Date: Sat, 24 Oct 2026 17:07:14 -0700 Subject: [PATCH 2/2] Simplify parametrize guidance in AGENTS.md Scope the loop preference to many simple cases and note when parametrize or separate tests fit better. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- AGENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index dd5f5d42e2..3dc1d79c72 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -65,7 +65,7 @@ lives under `pyiceberg/`, organized by concern rather than by engine: - Bias towards adding tests to existing files, rather than creating new files. - Use existing test fixtures when possible. - We have a strong bias towards integration testing over mocks. Mocks should be avoided whenever possible and should only be used if similar, existing tests are using mocks. -- Prefer a `for` loop in a single test over `@pytest.mark.parametrize`; each parametrized case adds per-test overhead that slows the suite. Include the input in assertion messages so failures are identifiable. Use `parametrize` only when cases need different fixtures (e.g., multiple catalogs). +- Prefer a `for` loop over `@pytest.mark.parametrize` for many simple cases; each parametrized case adds per-test overhead. Use `parametrize` when cases need different fixtures, and separate tests when cases are complex. ### Required CI and Merge Queue