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

Bug: attr.exceptions.FrozenInstanceError #254

Closed
Jasha10 opened this issue Feb 7, 2022 · 2 comments
Closed

Bug: attr.exceptions.FrozenInstanceError #254

Jasha10 opened this issue Feb 7, 2022 · 2 comments

Comments

@Jasha10
Copy link

Jasha10 commented Feb 7, 2022

Hi,

I'm getting an exception whose traceback involves pytest-cases.

Here is a minimal reproducer:

# min_repro_test.py
from pytest import fixture
from pytest_cases import parametrize_with_cases


@fixture
def foo_fixture():
    return 123


class MyCases:
    def case_arr_too_short(self, foo_fixture):
        return 456


@parametrize_with_cases("arg", cases=MyCases)
def test_get_tick_by_tick_sequence_of_best_bids_and_asks(arg) -> None:
    pass
$ pytest min_repro_test.py
================================================================== test session starts ==================================================================
platform linux -- Python 3.10.2, pytest-7.0.0, pluggy-1.0.0
rootdir: /home/jasha10/pysc, configfile: pyproject.toml
plugins: cases-3.6.8
collected 0 items / 1 error

======================================================================== ERRORS =========================================================================
_______________________________________________________ ERROR collecting repro/min_repro_test.py ________________________________________________________
../../miniconda3/envs/repro/lib/python3.10/site-packages/pluggy/_hooks.py:265: in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
../../miniconda3/envs/repro/lib/python3.10/site-packages/pluggy/_manager.py:80: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
../../miniconda3/envs/repro/lib/python3.10/site-packages/_pytest/python.py:257: in pytest_pycollect_makeitem
    res = list(collector._genfunctions(name, obj))
../../miniconda3/envs/repro/lib/python3.10/site-packages/_pytest/python.py:487: in _genfunctions
    fixtures.add_funcarg_pseudo_fixture_def(self, metafunc, fm)
../../miniconda3/envs/repro/lib/python3.10/site-packages/_pytest/fixtures.py:164: in add_funcarg_pseudo_fixture_def
    if not metafunc._calls[0].funcargs:
../../miniconda3/envs/repro/lib/python3.10/site-packages/pytest_cases/plugin.py:931: in __getitem__
    return self.calls_list[item]
../../miniconda3/envs/repro/lib/python3.10/site-packages/pytest_cases/plugin.py:942: in calls_list
    self.create_call_list_from_pending_parametrizations()
../../miniconda3/envs/repro/lib/python3.10/site-packages/pytest_cases/plugin.py:994: in create_call_list_from_pending_parametrizations
    remove_empty_ids(callspec)
../../miniconda3/envs/repro/lib/python3.10/site-packages/pytest_cases/fixture_parametrize_plus.py:556: in remove_empty_ids
    callspec._idlist = [c for c in callspec._idlist if not c.startswith(EMPTY_ID)]
../../miniconda3/envs/repro/lib/python3.10/site-packages/attr/_make.py:642: in _frozen_setattrs
    raise FrozenInstanceError()
E   attr.exceptions.FrozenInstanceError
================================================================ short test summary info ================================================================
ERROR min_repro_test.py - attr.exceptions.FrozenInstanceError
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=================================================================== 1 error in 0.20s ====================================================================

This is with the latest versions if pytest and pytest-cases installed from pypi.org.

@jammer87
Copy link
Contributor

jammer87 commented Feb 7, 2022

Same issue as #251

@Jasha10
Copy link
Author

Jasha10 commented Feb 8, 2022

I see, thanks @jammer87. I will close this issue in favor of #251.

@Jasha10 Jasha10 closed this as completed Feb 8, 2022
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