test: fix broken test_docstring_consistent_parameters and mark xfail - #4224
test: fix broken test_docstring_consistent_parameters and mark xfail#4224Aniketsy wants to merge 2 commits into
test_docstring_consistent_parameters and mark xfail#4224Conversation
|
🤖 AI text below 🤖 Code reviewFound 1 issue:
zarr-python/tests/test_api/test_synchronous.py Lines 112 to 128 in a994a4f The three tests cited as covering it all compare a sync/async pair of the same callable instead:
That said, the test as written was vacuously passing: every zarr-python/tests/test_api/test_synchronous.py Lines 45 to 52 in a994a4f So nothing is lost in terms of tests that were actually running, but the intended coverage — added deliberately in #3390 and maintained as recently as #4093 — is real and unimplemented. Repairing the test (iterate over the tuple, one parameter at a time) looks like the better fix than deleting it. If the intent is specifically to speed up the suite per #3989, this test contributes essentially nothing to runtime either way. 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
test_docstring_consistent_parameterstest_docstring_consistent_parameters and mark xfail
|
@d-v-b thanks for the review, I've fixed the broken test but that leads to failures, so i've marked test as |
| # across create/create_array/create_group/Group.create_array. Marked xfail | ||
| # for now so CI stays green but the issue is tracked, not forgotten. | ||
| # See #4225 | ||
| @pytest.mark.xfail( |
There was a problem hiding this comment.
instead of xfailing, can we make the test work properly, e.g. by fixing it, and fixing any docstring failures the fixed test reveals?
There was a problem hiding this comment.
instead of xfailing, can we make the test work properly, e.g. by fixing it, and fixing any docstring failures the fixed test reveals?
make sense, i'll be back with this shortly, maybe 1-2 days and fix this.
| types[val.type] = types[val.type] + (key,) | ||
| else: | ||
| types[val.type] = (key,) | ||
| for name in parameter_name: |
There was a problem hiding this comment.
iterating this way aggregates all parameters in the same dict, and then checks if they have the same description / type, which won't be true. we need to break down the aggregation per-parameter.
Summary
Towards #3989
Removedtest_docstring_consistent_parametersfromtests/test_api/test_synchronous.py. as i find its already covered heretest_docstrings_matchchecks almost the exact same thing (name/type/description)- for docstring coveragezarr-python/tests/test_api.py
Line 1437 in a994a4f
zarr-python/tests/test_group.py
Line 1792 in a994a4f
please feel free to point out if i'm missing something
[Describe what this PR changes and why, in your own words.]
For reviewers
[What would you most value a second look at? What are you already confident in? For a refactor, say whether behavior is meant to be unchanged.]
Author attestation
TODO
docs/user-guide/*.mdchanges/