Skip to content
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

Fix tests that fail with numpy v2 #347

Merged
merged 2 commits into from
Jul 3, 2024
Merged

Fix tests that fail with numpy v2 #347

merged 2 commits into from
Jul 3, 2024

Conversation

apotterri
Copy link
Collaborator

With the previous function in simple.py, the return event generated to
check that numpy.int64 serialized correctly didn't test AppMapEncoder.
Keys in a dict that are in a return event are rendered with "repr"
before the event gets serialized. "repr(int64(0))" returned "0" in 1.x,
but returns "numpy.int64(0)" in 2.x, which caused the test to fail.

It's (almost certainly) inconsistent that types appear verbatim in call events, and are rendered using "repr" in return events. Changing that will probably have broad implications, so this PR doesn't attempt to address that.

Fixes #345 .

When an actual appmap doesn't match the expected one, show it as JSON to
make it easier to understand why they're different (and to assist with
updating the expected, if appropriate).
@apotterri apotterri force-pushed the numpy2_20240702 branch 2 times, most recently from 61bd1b8 to aebd259 Compare July 2, 2024 21:19
With the previous function in simple.py, the return event generated to
check that numpy.int64 serialized correctly didn't test AppMapEncoder.
Keys in a dict that are in a return event are rendered with "repr"
before the event gets serialized. "repr(int64(0))" returned "0" in 1.x,
but returns "numpy.int64(0)" in 2.x, which caused the test to fail.
@apotterri apotterri merged commit 4bc86ba into master Jul 3, 2024
2 checks passed
@apotterri apotterri deleted the numpy2_20240702 branch July 3, 2024 09:01
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.

Release of numpy2 causes the Travis build to fail
2 participants