Skip to content
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

simple test example fails for Python 3.12 #12004

Closed
Monallabs opened this issue Feb 18, 2024 · 1 comment
Closed

simple test example fails for Python 3.12 #12004

Monallabs opened this issue Feb 18, 2024 · 1 comment

Comments

@Monallabs
Copy link

I am using Python 3.12 and this simple pytest fails to run.

Simple test example

import pytest

@pytest.fixture(name= "static_component_with_details",
                params = [({'tag': 'span', 'text' : "hello", 'classes':"p-1"}, "the_object"),
                          ]
                )
def _static_component_with_details(request):
    return request.param


def test_to_html_iter(static_component_with_details):
    details, component = static_component_with_details
    assert component == "the_object"

The error output

 pytest -s test_html_render_create_issue.py
==================================== test session starts ====================================
platform openbsd7 -- Python 3.12.2, pytest-8.0.1, pluggy-1.4.0
rootdir: /home/kabiraatmonallabs/Debug
plugins: anyio-4.2.0, cases-3.8.2, hypothesis-6.97.4, timeout-2.2.0, mock-3.11.1, speed-0.3.5, pretty-1.2.0
collected 0 items / 1 error                                                                 

========================================== ERRORS ===========================================
_____________________ ERROR collecting test_html_render_create_issue.py _____________________
../.local/share/virtualenvs/ofjustpy-IRz21Ee9/lib/python3.12/site-packages/_pytest/nodes.py:153: in _create
    return super().__call__(*k, **kw)
../.local/share/virtualenvs/ofjustpy-IRz21Ee9/lib/python3.12/site-packages/_pytest/python.py:1796: in __init__
    fixtureinfo = fm.getfixtureinfo(self, self.obj, self.cls)
../.local/share/virtualenvs/ofjustpy-IRz21Ee9/lib/python3.12/site-packages/_pytest/fixtures.py:1479: in getfixtureinfo
    names_closure, arg2fixturedefs = self.getfixtureclosure(
E   TypeError: getfixtureclosure() got an unexpected keyword argument 'initialnames'

During handling of the above exception, another exception occurred:
../.local/share/virtualenvs/ofjustpy-IRz21Ee9/lib/python3.12/site-packages/pluggy/_hooks.py:501: in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
../.local/share/virtualenvs/ofjustpy-IRz21Ee9/lib/python3.12/site-packages/pluggy/_manager.py:119: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
../.local/share/virtualenvs/ofjustpy-IRz21Ee9/lib/python3.12/site-packages/_pytest/python.py:278: in pytest_pycollect_makeitem
    return list(collector._genfunctions(name, obj))
../.local/share/virtualenvs/ofjustpy-IRz21Ee9/lib/python3.12/site-packages/_pytest/python.py:487: in _genfunctions
    definition: FunctionDefinition = FunctionDefinition.from_parent(
../.local/share/virtualenvs/ofjustpy-IRz21Ee9/lib/python3.12/site-packages/_pytest/python.py:1804: in from_parent
    return super().from_parent(parent=parent, **kw)
../.local/share/virtualenvs/ofjustpy-IRz21Ee9/lib/python3.12/site-packages/_pytest/nodes.py:276: in from_parent
    return cls._create(parent=parent, **kw)
../.local/share/virtualenvs/ofjustpy-IRz21Ee9/lib/python3.12/site-packages/_pytest/nodes.py:168: in _create
    return super().__call__(*k, **known_kw)
../.local/share/virtualenvs/ofjustpy-IRz21Ee9/lib/python3.12/site-packages/_pytest/python.py:1796: in __init__
    fixtureinfo = fm.getfixtureinfo(self, self.obj, self.cls)
../.local/share/virtualenvs/ofjustpy-IRz21Ee9/lib/python3.12/site-packages/_pytest/fixtures.py:1479: in getfixtureinfo
    names_closure, arg2fixturedefs = self.getfixtureclosure(
E   TypeError: getfixtureclosure() got an unexpected keyword argument 'initialnames'
===================================== warnings summary ======================================
../.local/share/virtualenvs/ofjustpy-IRz21Ee9/lib/python3.12/site-packages/_pytest/nodes.py:159
  /home/kabiraatmonallabs/.local/share/virtualenvs/ofjustpy-IRz21Ee9/lib/python3.12/site-packages/_pytest/nodes.py:159: PytestDeprecationWarning: <class '_pytest.python.FunctionDefinition'> is not using a cooperative constructor and only takes {'parent', 'callobj', 'name'}.
  See https://docs.pytest.org/en/stable/deprecations.html#constructors-of-custom-pytest-node-subclasses-should-take-kwargs for more details.
    warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!
Results (0.72s):
         1 warning
         1 error

Output of pip list

addict            2.4.0
aenum             3.1.15
aiofiles          23.2.1
anyio             4.2.0
asttokens         2.4.1
attrs             23.2.0
blake2signer      3.0.0
cachetools        5.3.2
certifi           2024.2.2
cfgv              3.4.0
click             8.1.7
colorama          0.4.6
coverage          7.4.1
decopatch         1.4.10
decorator         5.1.1
dirty-equals      0.7.1.post0
distlib           0.3.8
dnspython         2.6.0
dpath             2.1.6
EditorConfig      0.12.4
email-validator   2.1.0.post1
executing         2.0.1
filelock          3.13.1
griffe            0.40.0
h11               0.14.0
hjson             3.1.0
httpcore          1.0.3
httpx             0.26.0
hypothesis        6.97.4
identify          2.5.34
idna              3.6
iniconfig         2.0.0
ipython           8.21.0
itsdangerous      2.1.2
jedi              0.19.1
Jinja2            3.1.3
jsbeautifier      1.15.1
json-fix          1.0.0
jsonpath-ng       1.6.1
lxml              5.1.0
makefun           1.15.2
markdown-it-py    3.0.0
MarkupSafe        2.1.5
matplotlib-inline 0.1.6
mdurl             0.1.2
mypy              1.8.0
mypy-extensions   1.0.0
nodeenv           1.8.0
packaging         23.2
parso             0.8.3
pexpect           4.9.0
pip               24.0
platformdirs      4.2.0
pluggy            1.4.0
ply               3.11
pre-commit        3.6.1
prompt-toolkit    3.0.43
psutil            5.9.8
ptyprocess        0.7.0
pure-eval         0.2.2
Pygments          2.17.2
pyright           1.1.349
PySnooper         1.2.0
pytest            8.0.1
pytest-cases      3.8.2
pytest-mock       3.11.1
pytest-pretty     1.2.0
pytest-speed      0.3.5
pytest-timeout    2.2.0
python-dateutil   2.8.3.dev33+gf229320
pytz              2023.4
PyYAML            6.0.1
rich              13.7.0
ruff              0.1.15
setuptools        69.1.0
six               1.16.0
sniffio           1.3.0
sortedcontainers  2.4.0
stack-data        0.6.3
starlette         0.37.1
traitlets         5.14.1
typing_extensions 4.9.0
uvicorn           0.27.1
virtualenv        20.25.0
wcwidth           0.2.13
websockets        12.0
wheel             0.42.0
WTForms           3.1.2
@The-Compiler
Copy link
Member

The-Compiler commented Feb 18, 2024

This is due to pytest-cases being incompatible with pytest 8, see smarie/python-pytest-cases#330

@The-Compiler The-Compiler closed this as not planned Won't fix, can't repro, duplicate, stale Feb 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants