You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Test session starts (platform: linux, Python 3.8.4, pytest 5.4.3, pytest-sugar 0.9.4)
rootdir: /code/components/echo, inifile: pytest.ini
plugins: mock-3.2.0, cases-2.0.4, sugar-0.9.4, freezegun-0.4.1, cov-2.10.0
collecting ...
―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― ERROR collecting tests/test_authentication_middleware.py ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――tests/test_authentication_middleware.py:14: in <module>
def test_something(a, b):
/home/aladdin-user/.local/lib/python3.8/site-packages/pytest_cases/case_parametrizer_new.py:99: in _apply_parametrization
argvalues = get_parametrize_args(cases_funs)
/home/aladdin-user/.local/lib/python3.8/site-packages/pytest_cases/case_parametrizer_new.py:238: in get_parametrize_args
return [c for _f in cases_funs for c in case_to_argvalues(_f)]
/home/aladdin-user/.local/lib/python3.8/site-packages/pytest_cases/case_parametrizer_new.py:238: in <listcomp>
return [c for _f in cases_funs for c in case_to_argvalues(_f)]
/home/aladdin-user/.local/lib/python3.8/site-packages/pytest_cases/case_parametrizer_new.py:291: in case_to_argvalues
raise NotImplementedError("We should check if this is the same or another and generate a new name in that "
E NotImplementedError: We should check if this is the same or another and generate a new name in that case
However, if I remove monkeypatch or freezer from one of the cases, or if I change the name of one of the cases, it runs the test.
The text was updated successfully, but these errors were encountered:
Sorry I finally take the time to look now actually - I had to close a series of other things.
I was able to reproduce the issue (note for future readers: no need to use the freezer plugin, using request fixture instead of freezer also produces the same bug)
When pytest cases collects some cases that require a fixture, it creates a fixture for that case. This fixture is registered locally in the current module. But of course local fixtures need to have unique names. In your example the name (that I derive from the case id) is case in both situations. I therefore changed a bit the logic in order to guarantee uniqueness. I should release the fix soon.
Running this code:
results in this error:
However, if I remove
monkeypatch
orfreezer
from one of the cases, or if I change the name of one of the cases, it runs the test.The text was updated successfully, but these errors were encountered: