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.91.0 makes pytest crashing #3804

Closed
SebastienAndreo opened this issue Nov 27, 2023 · 2 comments
Closed

Hypothesis 6.91.0 makes pytest crashing #3804

SebastienAndreo opened this issue Nov 27, 2023 · 2 comments

Comments

@SebastienAndreo
Copy link

the Hypothesis 6.91.0 makes pytest crashing

pytest                        7.4.0
pytest-cov                    4.1.0
pytest-mock                   3.12.0
pytest-subtests               0.7.0
YTHONPATH=src pytest --verbose  --cov="./users/users"  --junitxml=pytest-report.xml . | tee pytest.txt
Traceback (most recent call last):
 File "/home/vscode/.local/bin/pytest", line 8, in <module>
   sys.exit(console_main())
 File "/home/vscode/.local/lib/python3.10/site-packages/_pytest/config/__init__.py", line 189, in console_main
   code = main()
 File "/home/vscode/.local/lib/python3.10/site-packages/_pytest/config/__init__.py", line 147, in main
   config = _prepareconfig(args, plugins)
 File "/home/vscode/.local/lib/python3.10/site-packages/_pytest/config/__init__.py", line 328, in _prepareconfig
   config = pluginmanager.hook.pytest_cmdline_parse(
 File "/home/vscode/.local/lib/python3.10/site-packages/pluggy/_hooks.py", line 433, in __call__
   return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
 File "/home/vscode/.local/lib/python3.10/site-packages/pluggy/_manager.py", line 112, in _hookexec
   return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
 File "/home/vscode/.local/lib/python3.10/site-packages/pluggy/_callers.py", line 133, in _multicall
   teardown[0].send(outcome)
 File "/home/vscode/.local/lib/python3.10/site-packages/_pytest/helpconfig.py", line 103, in pytest_cmdline_parse
   config: Config = outcome.get_result()
 File "/home/vscode/.local/lib/python3.10/site-packages/pluggy/_result.py", line 108, in get_result
   raise exc.with_traceback(exc.__traceback__)
 File "/home/vscode/.local/lib/python3.10/site-packages/pluggy/_callers.py", line 80, in _multicall
   res = hook_impl.function(*args)
 File "/home/vscode/.local/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1075, in pytest_cmdline_parse
   self.parse(args)
 File "/home/vscode/.local/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1425, in parse
   self._preparse(args, addopts=addopts)
 File "/home/vscode/.local/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1305, in _preparse
   self.pluginmanager.load_setuptools_entrypoints("pytest11")
 File "/home/vscode/.local/lib/python3.10/site-packages/pluggy/_manager.py", line 364, in load_setuptools_entrypoints
   plugin = ep.load()
 File "/usr/local/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
   module = import_module(match.group('module'))
 File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
   return _bootstrap._gcd_import(name[level:], package, level)
 File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
 File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
 File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
 File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
 File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
 File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
 File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
 File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
 File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
 File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
 File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
 File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
 File "/home/vscode/.local/lib/python3.10/site-packages/_pytest/assertion/rewrite.py", line 178, in exec_module
   exec(co, module.__dict__)
 File "/home/vscode/.local/lib/python3.10/site-packages/schemathesis/__init__.py", line 7, in <module>
   from . import auths, checks, contrib, fixups, graphql, hooks, runner, serializers, targets  # noqa: E402
 File "/home/vscode/.local/lib/python3.10/site-packages/_pytest/assertion/rewrite.py", line 178, in exec_module
   exec(co, module.__dict__)
 File "/home/vscode/.local/lib/python3.10/site-packages/schemathesis/checks.py", line 5, in <module>
   from .specs.openapi.checks import (
 File "/home/vscode/.local/lib/python3.10/site-packages/_pytest/assertion/rewrite.py", line 178, in exec_module
   exec(co, module.__dict__)
 File "/home/vscode/.local/lib/python3.10/site-packages/schemathesis/specs/openapi/__init__.py", line 3, in <module>
   from .loaders import from_aiohttp, from_asgi, from_dict, from_file, from_path, from_pytest_fixture, from_uri, from_wsgi
 File "/home/vscode/.local/lib/python3.10/site-packages/_pytest/assertion/rewrite.py", line 178, in exec_module
   exec(co, module.__dict__)
 File "/home/vscode/.local/lib/python3.10/site-packages/schemathesis/specs/openapi/loaders.py", line 21, in <module>
   from ...lazy import LazySchema
 File "/home/vscode/.local/lib/python3.10/site-packages/_pytest/assertion/rewrite.py", line 178, in exec_module
   exec(co, module.__dict__)
 File "/home/vscode/.local/lib/python3.10/site-packages/schemathesis/lazy.py", line 9, in <module>
   from hypothesis.internal.escalation import format_exception, get_interesting_origin, get_trimmed_traceback
ImportError: cannot import name 'get_interesting_origin' from 'hypothesis.internal.escalation' (/home/vscode/.local/lib/python3.10/site-packages/hypothesis/internal/escalation.py)
@tybug
Copy link
Member

tybug commented Nov 27, 2023

Traceback implies that this is an issue with Schemathesis, caused by recent internal changes in hypothesis. It seems that Schemathesis has already fixed this in 3.12.2.

Can you try upgrading Schemathesis and see if that resolves the issue?

@SebastienAndreo
Copy link
Author

You are right solved with schema thesis 3.21.2.

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