You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During #1156, we figured out that after bumping python dependencies (pytest>8.0), unit tests in some charm repos fail with the following error:
AttributeError: 'CallSpec2' object has no attribute 'funcargs'
This is caused by issue TvoroG/pytest-lazy-fixture#65. The referenced package is though unmaintained and thus does not work with pytest>=8.0. What is being suggested is to switch from pytest-lazy-fixture to pytest-lazy-fixtures (with an "s" at the end), which seems to be supporting all the features of the first one + being maintained. In some cases, the pytest-lazy-fixtures is a leftover package not used anymore and can be just removed from the packages (ie resource-dispatcher canonical/resource-dispatcher#77)
To Reproduce
Run unit test in repositories affected.
Environment
main branch
Relevant Log Output
# from mlflow repo https://github.com/canonical/mlflow-operator/actions/runs/12195468207/job/34021150692
____________________ ERROR collecting tests/unit/test_s3.py ____________________
Traceback (most recent call last):
File "/home/runner/work/mlflow-operator/mlflow-operator/.tox/unit/lib/python3.8/site-packages/_pytest/runner.py", line 341, in from_call
result: TResult | None = func()
File "/home/runner/work/mlflow-operator/mlflow-operator/.tox/unit/lib/python3.8/site-packages/_pytest/runner.py", line 389, in collect
returnlist(collector.collect())
File "/home/runner/work/mlflow-operator/mlflow-operator/.tox/unit/lib/python3.8/site-packages/_pytest/python.py", line 552, in collect
returnsuper().collect()
File "/home/runner/work/mlflow-operator/mlflow-operator/.tox/unit/lib/python3.8/site-packages/_pytest/python.py", line 419, in collect
res = ihook.pytest_pycollect_makeitem(
File "/home/runner/work/mlflow-operator/mlflow-operator/.tox/unit/lib/python3.8/site-packages/pluggy/_hooks.py", line 513, in __call__
return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
File "/home/runner/work/mlflow-operator/mlflow-operator/.tox/unit/lib/python3.8/site-packages/pluggy/_manager.py", line 120, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "/home/runner/work/mlflow-operator/mlflow-operator/.tox/unit/lib/python3.8/site-packages/pluggy/_callers.py", line 182, in _multicall
returnoutcome.get_result()
File "/home/runner/work/mlflow-operator/mlflow-operator/.tox/unit/lib/python3.8/site-packages/pluggy/_result.py", line 100, in get_result
raise exc.with_traceback(exc.__traceback__)
File "/home/runner/work/mlflow-operator/mlflow-operator/.tox/unit/lib/python3.8/site-packages/pluggy/_callers.py", line 103, in _multicall
res = hook_impl.function(*args)
File "/home/runner/work/mlflow-operator/mlflow-operator/.tox/unit/lib/python3.8/site-packages/_pytest/python.py", line 245, in pytest_pycollect_makeitem
return list(collector._genfunctions(name, obj))
File "/home/runner/work/mlflow-operator/mlflow-operator/.tox/unit/lib/python3.8/site-packages/_pytest/python.py", line 462, in _genfunctions
self.ihook.pytest_generate_tests.call_extra(methods, dict(metafunc=metafunc))
File "/home/runner/work/mlflow-operator/mlflow-operator/.tox/unit/lib/python3.8/site-packages/pluggy/_hooks.py", line 574, in call_extra
return self._hookexec(self.name, hookimpls, kwargs, firstresult)
File "/home/runner/work/mlflow-operator/mlflow-operator/.tox/unit/lib/python3.8/site-packages/pluggy/_manager.py", line 120, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "/home/runner/work/mlflow-operator/mlflow-operator/.tox/unit/lib/python3.8/site-packages/pluggy/_callers.py", line 156, in _multicall
teardown[0].send(outcome)
File "/home/runner/work/mlflow-operator/mlflow-operator/.tox/unit/lib/python3.8/site-packages/pytest_lazyfixture.py", line 74, in pytest_generate_tests
normalize_metafunc_calls(metafunc, 'funcargs')
File "/home/runner/work/mlflow-operator/mlflow-operator/.tox/unit/lib/python3.8/site-packages/pytest_lazyfixture.py", line 81, in normalize_metafunc_calls
calls = normalize_call(callspec, metafunc, valtype, used_keys)
File "/home/runner/work/mlflow-operator/mlflow-operator/.tox/unit/lib/python3.8/site-packages/pytest_lazyfixture.py", line 105, in normalize_call
valtype_keys = set(getattr(callspec, valtype).keys()) - used_keys
AttributeError: 'CallSpec2' object has no attribute 'funcargs'
=============================== warnings summary ===============================
.tox/unit/lib/python3.8/site-packages/_pytest/python.py:462
/home/runner/work/mlflow-operator/mlflow-operator/.tox/unit/lib/python3.8/site-packages/_pytest/python.py:462: PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown.
Plugin: lazy-fixture, Hook: pytest_generate_tests
AttributeError: 'CallSpec2' object has no attribute 'funcargs'
For more information see https://pluggy.readthedocs.io/en/stable/api_reference.html#pluggy.PluggyTeardownRaisedWarning
self.ihook.pytest_generate_tests.call_extra(methods, dict(metafunc=metafunc))
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
ERROR tests/unit/test_s3.py - AttributeError: 'CallSpec2' object has no attribute 'funcargs'!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
Additional Context
No response
The text was updated successfully, but these errors were encountered:
Bug Description
During #1156, we figured out that after bumping python dependencies (pytest>8.0), unit tests in some charm repos fail with the following error:
This is caused by issue TvoroG/pytest-lazy-fixture#65. The referenced package is though unmaintained and thus does not work with
pytest>=8.0
. What is being suggested is to switch from pytest-lazy-fixture to pytest-lazy-fixtures (with an "s" at the end), which seems to be supporting all the features of the first one + being maintained. In some cases, thepytest-lazy-fixtures
is a leftover package not used anymore and can be just removed from the packages (ie resource-dispatcher canonical/resource-dispatcher#77)To Reproduce
Run unit test in repositories affected.
Environment
main
branchRelevant Log Output
Additional Context
No response
The text was updated successfully, but these errors were encountered: