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

Internal API: ConjectureData.freeze() can suppress exceptions #4174

Open
jakkdl opened this issue Nov 14, 2024 · 0 comments
Open

Internal API: ConjectureData.freeze() can suppress exceptions #4174

jakkdl opened this issue Nov 14, 2024 · 0 comments
Labels
internals Stuff that only Hypothesis devs should ever see

Comments

@jakkdl
Copy link
Contributor

jakkdl commented Nov 14, 2024

def test_frozen_things():
    # Hypothesis reraises the TypeError as a StopTest, because the data is Frozen,
    # and never resurfaces the TypeError anywhere.
    @given(st.data())
    def foo(data):
        data.conjecture_data.freeze()
        raise TypeError("oops")

    foo()

DataObject.conjecture_data is not public API (see #4170) so we shouldn't have to worry about users
directly calling data.conjecture_data.freeze(), but it might be possible that exceptions in internal code gets suppressed.

@Zac-HD Zac-HD added the internals Stuff that only Hypothesis devs should ever see label Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internals Stuff that only Hypothesis devs should ever see
Projects
None yet
Development

No branches or pull requests

2 participants