Skip to content

symmetric_matrices: draw from finite if necessary #219

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
merged 2 commits into from
Dec 7, 2023

Conversation

jakevdp
Copy link
Contributor

@jakevdp jakevdp commented Dec 5, 2023

Currently, running array_api_tests/meta/test_hypothesis_helpers.py::test_symmetric_matrices produces a warning:

hypothesis.errors.HypothesisWarning: bool(shared(booleans(), key='finite')) is always True, did you mean to draw a value?

The reason is that this test passes a boolean hypothesis parameter to the symmetric_matrices utility, and we must draw that parameter before using it. Other tests pass a raw boolean value to the function, so a reasonable fix is to only draw the value if it's not already a bool instance.

With the change in this PR, the test no longer leads to a warning.

Copy link
Member

@honno honno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, LGTM thanks. I just pushed a commit to simplify the test generally.

Just incase you weren't aware, we have a --ci flag for pytest runs, which don't run these meta tests.

@honno honno merged commit 7c89cf1 into data-apis:master Dec 7, 2023
@jakevdp jakevdp deleted the symmetric-matrices branch December 7, 2023 13:30
@jakevdp
Copy link
Contributor Author

jakevdp commented Dec 7, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants