-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Description
I have pytest-cases 3.9.1 installed, and when I have pytest 9.0.0 or later installed, test collection fails with the following error. As a workaround, downgrade to pytest<9. Upon inspection, the values of super_closure are a subset of ref_fixturenames. I am unsure how to troubleshoot this further but am willing to dig into this further. Of note, the tests being collected at this stage do not use pytest-cases.
$ pytest --co --pdb
============================= test session starts ==============================
platform darwin -- Python 3.13.9, pytest-9.0.0, pluggy-1.6.0
sensitiveurl: .*
rootdir: /Users/meconomou/Documents/Code/Internet2/solon-backend
configfile: pyproject.toml
plugins: docker-3.2.5, reportlog-1.0.0, emoji-0.2.0, alembic-0.12.1, cases-3.9.1, Faker-38.0.0, variables-3.1.0, html-4.1.1, metadata-3.1.1, md-0.2.0, order-1.3.0, pytest_httpserver-1.1.3, base-url-2.1.0, selenium-4.1.0, cov-7.0.0, postgresql-7.0.2
collecting ...
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> traceback >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
.venv/lib/python3.13/site-packages/pluggy/_hooks.py:512: in __call__
return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.venv/lib/python3.13/site-packages/pluggy/_manager.py:120: in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.venv/lib/python3.13/site-packages/_pytest/python.py:249: in pytest_pycollect_makeitem
return list(collector._genfunctions(name, obj))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.venv/lib/python3.13/site-packages/_pytest/python.py:457: in _genfunctions
definition = FunctionDefinition.from_parent(self, name=name, callobj=funcobj)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.venv/lib/python3.13/site-packages/_pytest/python.py:1674: in from_parent
return super().from_parent(parent=parent, **kw)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.venv/lib/python3.13/site-packages/_pytest/nodes.py:233: in from_parent
return cls._create(parent=parent, **kw)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.venv/lib/python3.13/site-packages/_pytest/nodes.py:110: in _create
return super().__call__(*k, **kw) # type: ignore[no-any-return,misc]
^^^^^^^^^^^^^^^^^^^^^^^^^^
.venv/lib/python3.13/site-packages/_pytest/python.py:1665: in __init__
fixtureinfo = fm.getfixtureinfo(self, self.obj, self.cls)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.venv/lib/python3.13/site-packages/_pytest/fixtures.py:1580: in getfixtureinfo
names_closure, arg2fixturedefs = self.getfixtureclosure(
.venv/lib/python3.13/site-packages/pytest_cases/plugin.py:796: in getfixtureclosure
return _getfixtureclosure(fm, fixturenames=initialnames, parentnode=parentnode, ignore_args=ignore_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.venv/lib/python3.13/site-packages/pytest_cases/plugin.py:785: in _getfixtureclosure
assert set(super_closure) == set(ref_fixturenames)
E AssertionError: assert {'_session_faker', '_skip_sensitive', '_verify_url', 'base_url', 'docker_cleanup', 'docker_compose_command', ...} == {'_session_faker', '_skip_sensitive', '_verify_url', 'base_url', 'capabilities', 'chrome_options', ...}
E + where {'_session_faker', '_skip_sensitive', '_verify_url', 'base_url', 'docker_cleanup', 'docker_compose_command', ...} = set(['_session_faker', '_verify_url', 'base_url', 'sensitive_url', 'test_url', 'docker_ip', ...])
E + and {'_session_faker', '_skip_sensitive', '_verify_url', 'base_url', 'capabilities', 'chrome_options', ...} = set(['_session_faker', '_verify_url', 'test_url', 'base_url', 'sensitive_url', 'docker_ip', ...])
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> entering PDB >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> PDB post_mortem (IO-capturing turned off) >>>>>>>>>>>>>>>>>>>
> /Users/meconomou/Documents/Code/Internet2/solon-backend/.venv/lib/python3.13/site-packages/pytest_cases/plugin.py(785)_getfixtureclosure()
783 # NOTE different order happens all the time because of our "prepend" strategy in the closure building
784 # which makes much more sense/intuition than pytest default
--> 785 assert set(super_closure) == set(ref_fixturenames)
786 assert dict(arg2fixturedefs) == ref_arg2fixturedefs
787
ipdb>
steven-murray
Metadata
Metadata
Assignees
Labels
No labels