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

AsImmutable() does not propagate the return_str_if_not_expected param #16

Open
tigarmo opened this issue Nov 26, 2019 · 0 comments
Open

Comments

@tigarmo
Copy link

tigarmo commented Nov 26, 2019

Calling AsImmutable() on a sequence/container does not propagate the return_str_if_not_expected boolean parameter to the recursive calls of the function. That is, the second pytest.raises here fails (and the assertion passes):

def test_return_str_if_not_expected_recursive():
    from oop_ext.foundation.immutable import AsImmutable
    import numpy as np

    with pytest.raises(RuntimeError):
        AsImmutable(np.int32(5), return_str_if_not_expected=False)

    with pytest.raises(RuntimeError):
        assert AsImmutable([np.int32(5)], return_str_if_not_expected=False) == ('5',) 
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

No branches or pull requests

1 participant