Things to check first
Typeguard version
4.0.0rc4
Python version
python 3.8.15
What happened?
This repo is remarkable, thanks a lot!
I use pytest-6.2.5, and when I used pytest to test a python code embedded with typechecked ( I didn't use the pytest plugin), it failed like this:
Traceback (most recent call last):
File "/home/users/zhexin.li/miniconda3/envs/torch1102/bin/pytest", line 8, in <module>
sys.exit(console_main())
File "/home/users/zhexin.li/miniconda3/envs/torch1102/lib/python3.8/site-packages/_pytest/config/__init__.py", line 185, in console_main
code = main()
File "/home/users/zhexin.li/miniconda3/envs/torch1102/lib/python3.8/site-packages/_pytest/config/__init__.py", line 143, in main
config = _prepareconfig(args, plugins)
File "/home/users/zhexin.li/miniconda3/envs/torch1102/lib/python3.8/site-packages/_pytest/config/__init__.py", line 318, in _prepareconfig
config = pluginmanager.hook.pytest_cmdline_parse(
File "/home/users/zhexin.li/miniconda3/envs/torch1102/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
return self._hookexec(self, self.get_hookimpls(), kwargs)
File "/home/users/zhexin.li/miniconda3/envs/torch1102/lib/python3.8/site-packages/pluggy/manager.py", line 93, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File "/home/users/zhexin.li/miniconda3/envs/torch1102/lib/python3.8/site-packages/pluggy/manager.py", line 84, in <lambda>
self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
File "/home/users/zhexin.li/miniconda3/envs/torch1102/lib/python3.8/site-packages/pluggy/callers.py", line 203, in _multicall
gen.send(outcome)
File "/home/users/zhexin.li/miniconda3/envs/torch1102/lib/python3.8/site-packages/_pytest/helpconfig.py", line 100, in pytest_cmdline_parse
config: Config = outcome.get_result()
File "/home/users/zhexin.li/miniconda3/envs/torch1102/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result
raise ex[1].with_traceback(ex[2])
File "/home/users/zhexin.li/miniconda3/envs/torch1102/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall
res = hook_impl.function(*args)
File "/home/users/zhexin.li/miniconda3/envs/torch1102/lib/python3.8/site-packages/_pytest/config/__init__.py", line 1003, in pytest_cmdline_parse
self.parse(args)
File "/home/users/zhexin.li/miniconda3/envs/torch1102/lib/python3.8/site-packages/_pytest/config/__init__.py", line 1283, in parse
self._preparse(args, addopts=addopts)
File "/home/users/zhexin.li/miniconda3/envs/torch1102/lib/python3.8/site-packages/_pytest/config/__init__.py", line 1172, in _preparse
self.pluginmanager.load_setuptools_entrypoints("pytest11")
File "/home/users/zhexin.li/miniconda3/envs/torch1102/lib/python3.8/site-packages/pluggy/manager.py", line 299, in load_setuptools_entrypoints
plugin = ep.load()
File "/home/users/zhexin.li/miniconda3/envs/torch1102/lib/python3.8/importlib/metadata.py", line 77, in load
module = import_module(match.group('module'))
File "/home/users/zhexin.li/miniconda3/envs/torch1102/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "/home/users/zhexin.li/miniconda3/envs/torch1102/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 170, in exec_module
exec(co, module.__dict__)
File "/home/users/zhexin.li/miniconda3/envs/torch1102/lib/python3.8/site-packages/typeguard/_pytest_plugin.py", line 6, in <module>
from pytest import Config, Parser
ImportError: cannot import name 'Config' from 'pytest' (/home/users/zhexin.li/miniconda3/envs/torch1102/lib/python3.8/site-packages/pytest/__init__.py)
Updating pytest to the newest version could solve this problem, but it would result in conflicts with my other dependencies. Is there a way to avoild this problem and keep my pytest version?
How can we reproduce the bug?
pip install pytest==6.2.5 and pytest any program embedded with @TypeChecked
Things to check first
I have searched the existing issues and didn't find my bug already reported there
I have checked that my bug is still present in the latest release
Typeguard version
4.0.0rc4
Python version
python 3.8.15
What happened?
This repo is remarkable, thanks a lot!
I use pytest-6.2.5, and when I used pytest to test a python code embedded with typechecked ( I didn't use the pytest plugin), it failed like this:
Updating pytest to the newest version could solve this problem, but it would result in conflicts with my other dependencies. Is there a way to avoild this problem and keep my pytest version?
How can we reproduce the bug?
pip install pytest==6.2.5 and pytest any program embedded with @TypeChecked