Repository navigation
Conversation
Khabib73
commented
Nov 16, 2026
Comment on lines
21
to
23
| expected_keys: set[str] = set(sorted(params[0].keys())) | ||
| for idx, param in enumerate(params): | ||
| param_keys = set(sorted(param.keys())) |
Contributor
Author
There was a problem hiding this comment.
Do we need really sorting?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I think I found a bug in the parametrize logic 🤯🤯
I wrote two test cases where we should get a
ValueError, because the keys are not equal. Here is the code:We check that the other params have the same keys, but we do not check if they have extra keys. My test cases cover this. I recently refactored the logic in this function. Before, it looked like this:
The logic is the same! Please check this. Maybe I am wrong, but I am ready to fix this bug:
pytest_mypy_plugins/tests/test_logic.py:30: Failed ========================================================================================== short test summary info ========================================================================================== FAILED pytest_mypy_plugins/tests/test_logic.py::test_parametrized_with_wrong_keys[params0] - Failed: DID NOT RAISE ValueError FAILED pytest_mypy_plugins/tests/test_logic.py::test_parametrized_with_wrong_keys[params1] - Failed: DID NOT RAISE ValueError