-
Notifications
You must be signed in to change notification settings - Fork 47
fix: adapt fixture usage to newer pytest versions #879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
for more information, see https://pre-commit.ci
Zethson
reviewed
Nov 10, 2025
Member
Zethson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much!
mypy.....................................................................Failed
- hook id: mypy
- exit code: 1
pertpy/_logger.py:307: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
tests/tools/_distances/test_distances.py:33: error: Incompatible types in assignment (19 tuple items are incompatible; 16 items are omitted) [assignment]
tests/tools/_distances/test_distances.py:33: note: Expression tuple item 0 has type "str"; "Literal['edistance', 'euclidean', 'root_mean_squared_error', 'mse', 'mean_absolute_error', 'pearson_distance', 'spearman_distance', 'kendalltau_distance', 'cosine_distance', 'r2_distance', 'mean_pairwise', 'mmd', 'wasserstein', 'sym_kldiv', 't_test', 'ks_test', 'nb_ll', 'classifier_proba', 'classifier_cp', 'mean_var_distribution', 'mahalanobis']" expected;
tests/tools/_distances/test_distances.py:33: note: Expression tuple item 1 has type "str"; "Literal['edistance', 'euclidean', 'root_mean_squared_error', 'mse', 'mean_absolute_error', 'pearson_distance', 'spearman_distance', 'kendalltau_distance', 'cosine_distance', 'r2_distance', 'mean_pairwise', 'mmd', 'wasserstein', 'sym_kldiv', 't_test', 'ks_test', 'nb_ll', 'classifier_proba', 'classifier_cp', 'mean_var_distribution', 'mahalanobis']" expected;
tests/tools/_distances/test_distances.py:33: note: Expression tuple item 2 has type "str"; "Literal['edistance', 'euclidean', 'root_mean_squared_error', 'mse', 'mean_absolute_error', 'pearson_distance', 'spearman_distance', 'kendalltau_distance', 'cosine_distance', 'r2_distance', 'mean_pairwise', 'mmd', 'wasserstein', 'sym_kldiv', 't_test', 'ks_test', 'nb_ll', 'classifier_proba', 'classifier_cp', 'mean_var_distribution', 'mahalanobis']" expected;
tests/tools/_distances/test_distances.py:135: error: Incompatible types in assignment (expression has type "Distance", variable has type "Literal['edistance', 'euclidean', 'root_mean_squared_error', 'mse', 'mean_absolute_error', 'pearson_distance', 'spearman_distance', 'kendalltau_distance', 'cosine_distance', 'r2_distance', 'mean_pairwise', 'mmd', 'wasserstein', 'sym_kldiv', 't_test', 'ks_test', 'nb_ll', 'classifier_proba', 'classifier_cp', 'mean_var_distribution', 'mahalanobis']") [assignment]
tests/tools/_distances/test_distances.py:136: error: Item "str" of "Literal['edistance', 'euclidean', 'root_mean_squared_error', 'mse', 'mean_absolute_error', 'pearson_distance', 'spearman_distance', 'kendalltau_distance', 'cosine_distance', 'r2_distance', 'mean_pairwise', 'mmd', 'wasserstein', 'sym_kldiv', 't_test', 'ks_test', 'nb_ll', 'classifier_proba', 'classifier_cp', 'mean_var_distribution']" has no attribute "pairwise" [union-attr]
tests/tools/_distances/test_distances.py:220: error: Argument "mode" to "compare_distance" of "Distance" has incompatible type "Literal['new_mode']"; expected "Literal['simple', 'scaled']" [arg-type]
mypy has some complaints now. Let me know if you want me to have a look at them.
Zethson
approved these changes
Nov 10, 2025
Member
Zethson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<3
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.
PR Checklist
docsis updatedDescription of changes
pytest’s fixtures can no longer be annotated with marks: https://docs.pytest.org/en/stable/deprecations.html#applying-a-mark-to-a-fixture-function
this was used in
tests/tools/_distances/test_distances.pyin an attempt to clarify the dependency of some fixtures on thedistancetest parameterI switched this to the fixtures simply using the parameter directly.