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

Crash on parametrize(..., scope="package") without a Package #11255

Closed
bluetech opened this issue Jul 28, 2023 · 1 comment
Closed

Crash on parametrize(..., scope="package") without a Package #11255

bluetech opened this issue Jul 28, 2023 · 1 comment
Assignees
Labels
topic: parametrize related to @pytest.mark.parametrize type: bug problem that needs to be addressed

Comments

@bluetech
Copy link
Member

The following test crashes:

import pytest

@pytest.mark.parametrize("x", [0], scope="package")
def test_it(x): pass

with this traceback:

src/_pytest/runner.py:340: in from_call
    result: Optional[TResult] = func()
src/_pytest/runner.py:371: in <lambda>
    call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
src/_pytest/python.py:530: in collect
    return super().collect()
src/_pytest/python.py:451: in collect
    res = ihook.pytest_pycollect_makeitem(
.tox/venv/lib/python3.11/site-packages/pluggy/_hooks.py:433: in __call__
    return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
.tox/venv/lib/python3.11/site-packages/pluggy/_manager.py:112: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
src/_pytest/python.py:267: in pytest_pycollect_makeitem
    return list(collector._genfunctions(name, obj))
src/_pytest/python.py:501: in _genfunctions
    fixtures.add_funcarg_pseudo_fixture_def(self, metafunc, fm)
src/_pytest/fixtures.py:195: in add_funcarg_pseudo_fixture_def
    assert scope is Scope.Class and isinstance(
E   AssertionError
@bluetech bluetech added type: bug problem that needs to be addressed topic: parametrize related to @pytest.mark.parametrize labels Jul 28, 2023
@bluetech bluetech self-assigned this Jul 28, 2023
@bluetech
Copy link
Member Author

Was fixed in 71e627a.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: parametrize related to @pytest.mark.parametrize type: bug problem that needs to be addressed
Projects
None yet
Development

No branches or pull requests

1 participant