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

Return value checking #145

Closed
wants to merge 2 commits into from

Conversation

drewm1980
Copy link

I added a bit of return value checking on a couple fallible calls to C functions.

It would probably be more correct to throw proper python errors, but some checking is better than none.

Green local test run results:

$ ./scripts/test.sh 
======================================================================================================= test session starts =======================================================================================================
platform linux -- Python 3.9.15, pytest-4.6.5, py-1.11.0, pluggy-0.13.1
rootdir: /home/awagner/src/ormsgpack
plugins: asyncio-0.10.0, anyio-3.6.2
collected 283 items                                                                                                                                                                                                               

tests/test_api.py .......................                                                                                                                                                                                   [  8%]
tests/test_canonical.py ...                                                                                                                                                                                                 [  9%]
tests/test_circular.py ...                                                                                                                                                                                                  [ 10%]
tests/test_dataclass.py ................                                                                                                                                                                                    [ 15%]
tests/test_datetime.py ...........s..s.s.s..ss...........s.............                                                                                                                                                     [ 32%]
tests/test_default.py ................                                                                                                                                                                                      [ 38%]
tests/test_enum.py .............                                                                                                                                                                                            [ 43%]
tests/test_non_str_keys.py ........................                                                                                                                                                                         [ 51%]
tests/test_numpy.py .....................................                                                                                                                                                                   [ 64%]
tests/test_pydantic.py ..                                                                                                                                                                                                   [ 65%]
tests/test_subclass.py ................                                                                                                                                                                                     [ 71%]
tests/test_type.py .......s....................................................................                                                                                                                             [ 97%]
tests/test_typeddict.py .                                                                                                                                                                                                   [ 98%]
tests/test_uuid.py .....                                                                                                                                                                                                    [100%]

============================================================================================== 275 passed, 8 skipped in 0.52 seconds ==============================================================================================

Thanks!

Andrew Wagner added 2 commits February 1, 2023 16:02
@aviramha
Copy link
Owner

Sorry I just noticed this PR.
Do you still want to get it merged? the only concern I have is for performance and how common this might be? Did you face those errors in "real life"?

@aviramha
Copy link
Owner

It's been a while since last response - if you still want to merge it, please resolve conflicts and re-open a PR. Thank you.

@aviramha aviramha closed this Jul 14, 2024
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