Skip to content

Development: AttributeError in pytest_cases tests collection #162

@plammens

Description

@plammens

I forked the repo to work on #159 but I can't seem to run the tests in pytest_cases.tests, I'm getting a bunch of AttributeErrors at test collection when running pytest pytest_cases/tests, e.g.:

pytest_cases/tests/cases/doc/test_fixtures.py:None (pytest_cases/tests/cases/doc/test_fixtures.py)
..\..\venv\lib\site-packages\pluggy\hooks.py:286: in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
..\..\venv\lib\site-packages\pluggy\manager.py:93: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
..\..\venv\lib\site-packages\pluggy\manager.py:84: in <lambda>
    self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
..\..\venv\lib\site-packages\_pytest\python.py:249: in pytest_pycollect_makeitem
    res = list(collector._genfunctions(name, obj))
..\..\venv\lib\site-packages\_pytest\python.py:458: in _genfunctions
    definition = FunctionDefinition.from_parent(self, name=name, callobj=funcobj)
..\..\venv\lib\site-packages\_pytest\python.py:1619: in from_parent
    return super().from_parent(parent=parent, **kw)
..\..\venv\lib\site-packages\_pytest\nodes.py:190: in from_parent
    return cls._create(parent=parent, **kw)
..\..\venv\lib\site-packages\_pytest\nodes.py:94: in _create
    return super().__call__(*k, **kw)
..\..\venv\lib\site-packages\_pytest\python.py:1609: in __init__
    fixtureinfo = self.session._fixturemanager.getfixtureinfo(
..\..\venv\lib\site-packages\_pytest\fixtures.py:1464: in getfixtureinfo
    initialnames, names_closure, arg2fixturedefs = fm.getfixtureclosure(
..\plugin.py:615: in getfixtureclosure
    _init_fixnames, super_closure, arg2fixturedefs = create_super_closure(fm, parentnode, fixturenames, ignore_args)
..\plugin.py:669: in create_super_closure
    _merge(sorted_fixturenames, _init_fixnames)
..\plugin.py:656: in _merge
    into_list.append(item)
E   AttributeError: 'generator' object has no attribute 'append'

This happens for all tests; the error happens here:

def _merge(new_items, into_list):
""" Appends items from `new_items` into `into_list`, only if they are not already there. """
for item in new_items:
if item not in into_list:
into_list.append(item)

Version details:

atomicwrites==1.4.0
attrs==20.3.0
certifi==2020.12.5
chardet==3.0.4
colorama==0.4.4
decopatch==1.4.8
idna==2.10
iniconfig==1.1.1
makefun==1.9.5
packaging==20.8
pluggy==0.13.1
py==1.10.0
pyparsing==2.4.7
pytest==6.2.0
-e git+https://github.com/smarie/python-pytest-cases@8febdeeb52f6dcfcb54aa1e8e7d966427d030ad5#egg=pytest_cases
pytest-harvest==1.10.1
pytest-html==3.1.0
pytest-logging==2015.11.4
pytest-metadata==1.11.0
pytest-runner==5.2
pytest-steps==1.7.3
requests==2.25.0
setuptools-scm==5.0.0
six==1.15.0
toml==0.10.2
urllib3==1.26.2
wrapt==1.12.1
xunitparser==1.3.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions