Skip to content

get_unpacked_marks() got an unexpected keyword argument 'consider_mro' #654

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

Closed
Carreau opened this issue Oct 31, 2023 · 5 comments · Fixed by #660
Closed

get_unpacked_marks() got an unexpected keyword argument 'consider_mro' #654

Carreau opened this issue Oct 31, 2023 · 5 comments · Fixed by #660
Labels
Milestone

Comments

@Carreau
Copy link

Carreau commented Oct 31, 2023

I just got the following in CI

INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/pytest_asyncio/plugin.py", line 552, in pytest_collectstart
INTERNALERROR>     marks = get_unpacked_marks(collector.obj, consider_mro=True)
INTERNALERROR> TypeError: get_unpacked_marks() got an unexpected keyword argument 'consider_mro'

I can/will pin, but just warning you in case it matters. I am pinned to Pytest<7.1 for various reasons, so maybe you need to have a min version of pytest ?

Carreau added a commit to Carreau/ipython that referenced this issue Oct 31, 2023
Carreau added a commit to cohml/ipython that referenced this issue Oct 31, 2023
@MetRonnie
Copy link

MetRonnie commented Oct 31, 2023

I have started getting a similar error in CI. The only dependency version that changed since yesterday was pytest-asyncio

Log

INTERNALERROR> def worker_internal_error(self, node, formatted_error):
INTERNALERROR>         """
INTERNALERROR>         pytest_internalerror() was called on the worker.
INTERNALERROR>     
INTERNALERROR>         pytest_internalerror() arguments are an excinfo and an excrepr, which can't
INTERNALERROR>         be serialized, so we go with a poor man's solution of raising an exception
INTERNALERROR>         here ourselves using the formatted message.
INTERNALERROR>         """
INTERNALERROR>         self._active_nodes.remove(node)
INTERNALERROR>         try:
INTERNALERROR> >           assert False, formatted_error
INTERNALERROR> E           AssertionError: Traceback (most recent call last):
INTERNALERROR> E               File "/home/runner/work/cylc-flow/cylc-flow/cylc/flow/parsec/config.py", line 145, in get
INTERNALERROR> E                 cfg = cfg[key]
INTERNALERROR> E               File "/home/runner/work/cylc-flow/cylc-flow/cylc/flow/parsec/OrderedDict.py", line 38, in __getitem__
INTERNALERROR> E                 return OrderedDict.__getitem__(self, key)
INTERNALERROR> E             KeyError: '_remote_background_shared_tcp'
INTERNALERROR> E             
INTERNALERROR> E             During handling of the above exception, another exception occurred:
INTERNALERROR> E             
INTERNALERROR> E             Traceback (most recent call last):
INTERNALERROR> E               File "/home/runner/work/cylc-flow/cylc-flow/tests/unit/test_host_select_remote.py", line 48, in <module>
INTERNALERROR> E                 remote_platform = glbl_cfg().get(
INTERNALERROR> E               File "/home/runner/work/cylc-flow/cylc-flow/cylc/flow/parsec/config.py", line 151, in get
INTERNALERROR> E                 raise ItemNotFoundError(itemstr(parents, key))
INTERNALERROR> E             cylc.flow.parsec.exceptions.ItemNotFoundError: You have not set "[platforms]_remote_background_shared_tcp" in this config.
INTERNALERROR> E             
INTERNALERROR> E             During handling of the above exception, another exception occurred:
INTERNALERROR> E             
INTERNALERROR> E             Traceback (most recent call last):
INTERNALERROR> E               File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/_pytest/main.py", line 271, in wrap_session
INTERNALERROR> E                 session.exitstatus = doit(config, session) or 0
INTERNALERROR> E               File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/_pytest/main.py", line 324, in _main
INTERNALERROR> E                 config.hook.pytest_collection(session=session)
INTERNALERROR> E               File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pluggy/_hooks.py", line 493, in __call__
INTERNALERROR> E                 return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
INTERNALERROR> E               File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pluggy/_manager.py", line 115, in _hookexec
INTERNALERROR> E                 return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> E               File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pluggy/_callers.py", line 152, in _multicall
INTERNALERROR> E                 return outcome.get_result()
INTERNALERROR> E               File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pluggy/_result.py", line 114, in get_result
INTERNALERROR> E                 raise exc.with_traceback(exc.__traceback__)
INTERNALERROR> E               File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pluggy/_callers.py", line 77, in _multicall
INTERNALERROR> E                 res = hook_impl.function(*args)
INTERNALERROR> E               File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/_pytest/main.py", line 335, in pytest_collection
INTERNALERROR> E                 session.perform_collect()
INTERNALERROR> E               File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/_pytest/main.py", line 675, in perform_collect
INTERNALERROR> E                 self.items.extend(self.genitems(node))
INTERNALERROR> E               File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/_pytest/main.py", line 845, in genitems
INTERNALERROR> E                 yield from self.genitems(subnode)
INTERNALERROR> E               File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/_pytest/main.py", line 842, in genitems
INTERNALERROR> E                 rep = collect_one_node(node)
INTERNALERROR> E               File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/_pytest/runner.py", line 546, in collect_one_node
INTERNALERROR> E                 ihook.pytest_collectstart(collector=collector)
INTERNALERROR> E               File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pluggy/_hooks.py", line 493, in __call__
INTERNALERROR> E                 return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
INTERNALERROR> E               File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pluggy/_manager.py", line 115, in _hookexec
INTERNALERROR> E                 return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> E               File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pluggy/_callers.py", line 113, in _multicall
INTERNALERROR> E                 raise exception.with_traceback(exception.__traceback__)
INTERNALERROR> E               File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pluggy/_callers.py", line 77, in _multicall
INTERNALERROR> E                 res = hook_impl.function(*args)
INTERNALERROR> E               File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pytest_asyncio/plugin.py", line 552, in pytest_collectstart
INTERNALERROR> E                 marks = get_unpacked_marks(collector.obj, consider_mro=True)
INTERNALERROR> E               File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/_pytest/python.py", line 310, in obj
INTERNALERROR> E                 self._obj = obj = self._getobj()
INTERNALERROR> E               File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/_pytest/python.py", line 528, in _getobj
INTERNALERROR> E                 return self._importtestmodule()
INTERNALERROR> E               File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/_pytest/python.py", line 617, in _importtestmodule
INTERNALERROR> E                 mod = import_path(self.path, mode=importmode, root=self.config.rootpath)
INTERNALERROR> E               File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/_pytest/pathlib.py", line 567, in import_path
INTERNALERROR> E                 importlib.import_module(module_name)
INTERNALERROR> E               File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/importlib/__init__.py", line 127, in import_module
INTERNALERROR> E                 return _bootstrap._gcd_import(name[level:], package, level)
INTERNALERROR> E               File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
INTERNALERROR> E               File "<frozen importlib._bootstrap>", line 991, in _find_and_load
INTERNALERROR> E               File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
INTERNALERROR> E               File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
INTERNALERROR> E               File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 186, in exec_module
INTERNALERROR> E                 exec(co, module.__dict__)
INTERNALERROR> E               File "/home/runner/work/cylc-flow/cylc-flow/tests/unit/test_host_select_remote.py", line 61, in <module>
INTERNALERROR> E                 pytest.skip('Remote test host not available', allow_module_level=True)
INTERNALERROR> E               File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/_pytest/outcomes.py", line 179, in skip
INTERNALERROR> E                 raise Skipped(msg=reason, allow_module_level=allow_module_level)
INTERNALERROR> E             Skipped: Remote test host not available
INTERNALERROR> E           assert False
INTERNALERROR> 
INTERNALERROR> /opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/xdist/dsession.py:197: AssertionError
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/_pytest/main.py", line 271, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/_pytest/main.py", line 325, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pluggy/_hooks.py", line 493, in __call__
INTERNALERROR>     return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pluggy/_manager.py", line 115, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pluggy/_callers.py", line 130, in _multicall
INTERNALERROR>     teardown[0].send(outcome)
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pluggy/_result.py", line 114, in get_result
INTERNALERROR>     raise exc.with_traceback(exc.__traceback__)
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pluggy/_callers.py", line 77, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/xdist/dsession.py", line 1[22](https://github.com/cylc/cylc-flow/actions/runs/6704426380/job/18216810060#step:11:23), in pytest_runtestloop
INTERNALERROR>     self.loop_once()
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/xdist/dsession.py", line 1[45](https://github.com/cylc/cylc-flow/actions/runs/6704426380/job/18216810060#step:11:46), in loop_once
INTERNALERROR>     call(**kwargs)
INTERNALERROR>   File "/opt/hostedtoolcache/Python/3.8.18/x[64](https://github.com/cylc/cylc-flow/actions/runs/6704426380/job/18216810060#step:11:65)/lib/python3.8/site-packages/xdist/dsession.py", line 1[85](https://github.com/cylc/cylc-flow/actions/runs/6704426380/job/18216810060#step:11:86), in worker_workerfinished
INTERNALERROR>     self._active_nodes.remove(node)
INTERNALERROR> KeyError: <WorkerController gw2>

@MetRonnie
Copy link

Looks like the same as #655

@Carreau
Copy link
Author

Carreau commented Oct 31, 2023

Not sure mine is the same as yours, as TypeError: get_unpacked_marks() got an unexpected keyword argument 'consider_mro' is the root of my error, but yours might be the same as #655 indeed.

@MetRonnie
Copy link

Yes you're right, it must be a different bug

@seifertm
Copy link
Contributor

Thanks for the report. Apparently, the consider_mro kwarg is only available as of pytest v7.2.0.

The pytest-asyncio CI should test against the minimum supported pytest version (i.e. v7.0.0), so we need to check why this hasn't been caught by CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants