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 types for TestCase.assertJSON{Not,}Equal #2497

Merged

Conversation

nickstenning
Copy link
Contributor

The implementation of this function just passes the raw value to json.loads, which is typed as accepting strings, bytes objects, or bytearrays.

Update the signature of assertJSONEqual and assertJSONNotEqual to match.

Please let me know if I missed important things from the contributor process?

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Thanks!

tests/typecheck/test/test_testcase.yml Outdated Show resolved Hide resolved
The implementation of this function just passes the `raw` value to
`json.loads`, which [is typed as accepting][1] strings, bytes objects,
or bytearrays.

Update the signature of `assertJSONEqual` and `assertJSONNotEqual` to
match.

[1]: https://github.com/python/typeshed/blob/aac4394eb29d86797628b57d6f01f5e17f5ff83f/stdlib/json/__init__.pyi#L40
@nickstenning nickstenning force-pushed the fix-assert-json-equals-types branch from f6f1ebc to ff0600d Compare February 3, 2025 17:11
@sobolevn sobolevn merged commit e494d44 into typeddjango:master Feb 3, 2025
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants