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

hypothesis@6.89.0: AttributeError: 'list' object has no attribute 'result' #3793

Closed
sobolevn opened this issue Nov 17, 2023 · 2 comments
Closed

Comments

@sobolevn
Copy link
Member

This new release breaks my hypothesis + hypothesmith test:

______________________________ test_no_exceptions ______________________________

default_options = options(min_name_length=2, max_name_length=45, i_control_code=True, i_dont_control_code=True, max_noqa_comments=10, ne...level=3, max_annotation_complexity=3, max_import_from_members=8, max_tuple_unpack_length=4, show_violation_links=False)
parse_ast_tree = <function parse_ast_tree.<locals>.factory at 0x7f5d914a4940>

    @given(source_code=hypothesmith.from_grammar().map(_fixup))
>   @settings(print_blob=True)

tests/test_checker/test_hypothesis.py:40: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.venv/lib/python3.10/site-packages/hypothesmith/syntactic.py:66: in do_draw
    result = super().do_draw(data)
.venv/lib/python3.10/site-packages/hypothesis/extra/lark.py:128: in do_draw
    self.draw_symbol(data, start, state)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <hypothesmith.syntactic.GrammarStrategy object at 0x7f5f295316c0>
data = ConjectureData(VALID, 0 bytes, frozen)
symbol = NonTerminal(Token('RULE', 'file_input')), draw_state = []

    def draw_symbol(self, data, symbol, draw_state):  # type: ignore
>       count = len(draw_state.result)
E       AttributeError: 'list' object has no attribute 'result'
E       
E       You can reproduce this example by temporarily adding @reproduce_failure('6.89.0', b'AA==') as a decorator on your test case

I don't know which tool in correct / which is not. So, reporting here.

Link: https://github.com/wemake-services/wemake-python-styleguide/actions/runs/6899152254/job/18770296459?pr=2775
Source: https://github.com/wemake-services/wemake-python-styleguide/blob/ccc5728a6c1114ca11771e567b99c7b37a7dd87c/tests/test_checker/test_hypothesis.py#L41

I am using hypothesmith@0.3.0.

@Zac-HD
Copy link
Member

Zac-HD commented Nov 17, 2023

Hypothesmith bug - I used some private internals downstream which just changed upstream. I'll aim to get a fix out this weekend!

@Zac-HD
Copy link
Member

Zac-HD commented Nov 17, 2023

@Zac-HD Zac-HD closed this as completed Nov 17, 2023
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

2 participants