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

[BUG] Error after upgrading to hypothesis 6.49 #1538

Closed
2 tasks done
Mec-iS opened this issue Jul 5, 2022 · 1 comment · Fixed by #1544
Closed
2 tasks done

[BUG] Error after upgrading to hypothesis 6.49 #1538

Mec-iS opened this issue Jul 5, 2022 · 1 comment · Fixed by #1544
Assignees
Labels
Status: Needs Triage Requires initial assessment to categorize and prioritize Type: Bug Errors or unexpected behavior

Comments

@Mec-iS
Copy link

Mec-iS commented Jul 5, 2022

Checklist

Describe the bug
An error occurs when running a simple test with library hypothesis version 6.49.1. The test is the basic:

@schema.parametrize()
def test_api(case):
    response = case.call_asgi()
    case.validate_response(response)

No change in the API specs.

Successful run

platform linux -- Python 3.8.10, pytest-7.1.2, pluggy-1.0.0
rootdir: ..., configfile: pytest.ini
plugins: anyio-3.5.0, schemathesis-3.15.6, ***hypothesis-6.48.1***, subtests-0.5.0, nbmake-1.3.0
collected 20 items                                                                                                                                                                                

tests/ ....................    

After upgrading

After upgrading hypothesis to the latest minor:

platform linux -- Python 3.8.10, pytest-7.1.2, pluggy-1.0.0
rootdir: ..., configfile: pytest.ini
plugins: anyio-3.5.0, schemathesis-3.15.6, ***hypothesis-6.49.1***, subtests-0.5.0, nbmake-1.3.0
collected 0 items / 1 error                                                                                                                                                                       

============================================================================================= ERRORS ==============================================================================================
_________________________________________________________________________ ERROR collecting tests/client/test_by_schema.py _________________________________________________________________________
../.venv/lib/python3.8/site-packages/pluggy/_hooks.py:265: in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
../.venv/lib/python3.8/site-packages/pluggy/_manager.py:80: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
../.venv/lib/python3.8/site-packages/schemathesis/extra/pytest_plugin.py:211: in pytest_pycollect_makeitem
    outcome.force_result(create(SchemathesisCase, parent=collector, test_function=obj, name=name))
../.venv/lib/python3.8/site-packages/schemathesis/extra/pytest_plugin.py:38: in create
    return cls.from_parent(*args, **kwargs)  # type: ignore
../.venv/lib/python3.8/site-packages/_pytest/nodes.py:264: in from_parent
    return cls._create(parent=parent, **kw)
../.venv/lib/python3.8/site-packages/_pytest/nodes.py:140: in _create
    return super().__call__(*k, **kw)
../.venv/lib/python3.8/site-packages/schemathesis/extra/pytest_plugin.py:78: in __init__
    failing_test = validate_given_args(test_function, given_args, given_kwargs)
../.venv/lib/python3.8/site-packages/schemathesis/utils.py:446: in validate_given_args
    return is_invalid_test(func, argspec, args, kwargs)  # type: ignore
../.venv/lib/python3.8/site-packages/hypothesis/core.py:278: in is_invalid_test
    params = list(original_sig.parameters.values())
E   AttributeError: 'FullArgSpec' object has no attribute 'parameters'

Expected behavior
Test should work with the latest hypothesis version

see at HypothesisWorks/hypothesis#3397

I found everything to work ok if pinned to hypothesis == 6.48.3 or lower.

@Mec-iS Mec-iS added Status: Needs Triage Requires initial assessment to categorize and prioritize Type: Bug Errors or unexpected behavior labels Jul 5, 2022
Stranger6667 added a commit that referenced this issue Jul 8, 2022
Stranger6667 added a commit that referenced this issue Jul 9, 2022
@Stranger6667
Copy link
Member

Thank you so much for reporting! The issue is fixed, but not yet released. I plan to make a new release next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Requires initial assessment to categorize and prioritize Type: Bug Errors or unexpected behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants