Closed AFerster closed 2 months ago
Pytest.mark.parametrize raises error when i use version 6.1.0 of qase-pytest plugin
I happens if i use keyword arguments in pytest.mark.parametrize: pytest.mark.parametrize(argnames="foo", argvalues=["bar","baz"])
pytest.mark.parametrize(argnames="foo", argvalues=["bar","baz"])
Everything works fine if i enter positional arguments, but anyway plugin shouldn't break normal behavior of pytest.
It seems that the reason is this block of code:
i use pytest==8.0.0 version
Error: INTERNALERROR> Traceback (most recent call last): INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/_pytest/main.py", line 272, in wrap_session INTERNALERROR> session.exitstatus = doit(config, session) or 0 INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/_pytest/main.py", line 325, in _main INTERNALERROR> config.hook.pytest_collection(session=session) INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/pluggy/_hooks.py", line 513, in call INTERNALERROR> return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/pluggy/_manager.py", line 120, in _hookexec INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult) INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/pluggy/_callers.py", line 139, in _multicall INTERNALERROR> raise exception.with_traceback(exception.traceback) INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/pluggy/_callers.py", line 122, in _multicall INTERNALERROR> teardown.throw(exception) # type: ignore[union-attr] INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/_pytest/logging.py", line 783, in pytest_collection INTERNALERROR> return (yield) INTERNALERROR> ^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/pluggy/_callers.py", line 122, in _multicall INTERNALERROR> teardown.throw(exception) # type: ignore[union-attr] INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/_pytest/warnings.py", line 118, in pytest_collection INTERNALERROR> return (yield) INTERNALERROR> ^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/pluggy/_callers.py", line 122, in _multicall INTERNALERROR> teardown.throw(exception) # type: ignore[union-attr] INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/_pytest/config/init.py", line 1365, in pytest_collection INTERNALERROR> return (yield) INTERNALERROR> ^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/pluggy/_callers.py", line 103, in _multicall INTERNALERROR> res = hook_impl.function(args) INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/_pytest/main.py", line 336, in pytest_collection INTERNALERROR> session.perform_collect() INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/_pytest/main.py", line 802, in perform_collect INTERNALERROR> hook.pytest_collection_modifyitems( INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/pluggy/_hooks.py", line 513, in call INTERNALERROR> return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/pluggy/_manager.py", line 120, in _hookexec INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult) INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/pluggy/_callers.py", line 139, in _multicall INTERNALERROR> raise exception.with_traceback(exception.traceback) INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/pluggy/_callers.py", line 122, in _multicall INTERNALERROR> teardown.throw(exception) # type: ignore[union-attr] INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/_pytest/cacheprovider.py", line 413, in pytest_collection_modifyitems INTERNALERROR> res = yield INTERNALERROR> ^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/pluggy/_callers.py", line 122, in _multicall INTERNALERROR> teardown.throw(exception) # type: ignore[union-attr] INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/_pytest/cacheprovider.py", line 339, in pytest_collection_modifyitems INTERNALERROR> res = yield INTERNALERROR> ^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/pluggy/_callers.py", line 103, in _multicall INTERNALERROR> res = hook_impl.function(args) INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/qase/pytest/plugin.py", line 79, in pytest_collection_modifyitems INTERNALERROR> param_name, values = mark.args INTERNALERROR> ^^^^^^^^^^^^^^^^^^ INTERNALERROR> ValueError: not enough values to unpack (expected 2, got 0)
plus
@AFerster @ArtyrKa1300 try to use qase-pytest 6.1.1b4
Pytest.mark.parametrize raises error when i use version 6.1.0 of qase-pytest plugin
I happens if i use keyword arguments in pytest.mark.parametrize:
pytest.mark.parametrize(argnames="foo", argvalues=["bar","baz"])
Everything works fine if i enter positional arguments, but anyway plugin shouldn't break normal behavior of pytest.
It seems that the reason is this block of code:
i use pytest==8.0.0 version
Error: INTERNALERROR> Traceback (most recent call last): INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/_pytest/main.py", line 272, in wrap_session INTERNALERROR> session.exitstatus = doit(config, session) or 0 INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/_pytest/main.py", line 325, in _main INTERNALERROR> config.hook.pytest_collection(session=session) INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/pluggy/_hooks.py", line 513, in call INTERNALERROR> return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/pluggy/_manager.py", line 120, in _hookexec INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult) INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/pluggy/_callers.py", line 139, in _multicall INTERNALERROR> raise exception.with_traceback(exception.traceback) INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/pluggy/_callers.py", line 122, in _multicall INTERNALERROR> teardown.throw(exception) # type: ignore[union-attr] INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/_pytest/logging.py", line 783, in pytest_collection INTERNALERROR> return (yield) INTERNALERROR> ^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/pluggy/_callers.py", line 122, in _multicall INTERNALERROR> teardown.throw(exception) # type: ignore[union-attr] INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/_pytest/warnings.py", line 118, in pytest_collection INTERNALERROR> return (yield) INTERNALERROR> ^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/pluggy/_callers.py", line 122, in _multicall INTERNALERROR> teardown.throw(exception) # type: ignore[union-attr] INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/_pytest/config/init.py", line 1365, in pytest_collection INTERNALERROR> return (yield) INTERNALERROR> ^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/pluggy/_callers.py", line 103, in _multicall INTERNALERROR> res = hook_impl.function(args) INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/_pytest/main.py", line 336, in pytest_collection INTERNALERROR> session.perform_collect() INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/_pytest/main.py", line 802, in perform_collect INTERNALERROR> hook.pytest_collection_modifyitems( INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/pluggy/_hooks.py", line 513, in call INTERNALERROR> return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/pluggy/_manager.py", line 120, in _hookexec INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult) INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/pluggy/_callers.py", line 139, in _multicall INTERNALERROR> raise exception.with_traceback(exception.traceback) INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/pluggy/_callers.py", line 122, in _multicall INTERNALERROR> teardown.throw(exception) # type: ignore[union-attr] INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/_pytest/cacheprovider.py", line 413, in pytest_collection_modifyitems INTERNALERROR> res = yield INTERNALERROR> ^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/pluggy/_callers.py", line 122, in _multicall INTERNALERROR> teardown.throw(exception) # type: ignore[union-attr] INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/_pytest/cacheprovider.py", line 339, in pytest_collection_modifyitems INTERNALERROR> res = yield INTERNALERROR> ^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/pluggy/_callers.py", line 103, in _multicall INTERNALERROR> res = hook_impl.function(args) INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^ INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/qase/pytest/plugin.py", line 79, in pytest_collection_modifyitems INTERNALERROR> param_name, values = mark.args INTERNALERROR> ^^^^^^^^^^^^^^^^^^ INTERNALERROR> ValueError: not enough values to unpack (expected 2, got 0)