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
@RonnyPfannschmidt I agree, doesn't seem like something we want to actually fix, at least not in its current form where it was working by accident rather than by design.
@popravich when you can please let us know if the workaround worked for you.
I just found out about this today. Is it worth it to at least add a disclaimer somehow in the CHANGELOG? Our deployment to PROD was skipping some tests without us even noticing so I believe its something worth to comment.
Activity
popravich commentedon Nov 28, 2017
The same case is here https://github.com/aio-libs/aiohttp/blob/master/aiohttp/pytest_plugin.py#L195-L200
RonnyPfannschmidt commentedon Nov 28, 2017
its neither intended, not was it a bug
we simply didn't fall over because users would mutate random aliased objects that would then end up in the internals
the correct way to make fixtures dynamic is something like this:
popravich commentedon Nov 28, 2017
Ok, thanks,
I will try it
nicoddemus commentedon Nov 28, 2017
Do we still consider this
regression?RonnyPfannschmidt commentedon Nov 28, 2017
@nicoddemus it practically is a regression, but its one i'd like to not fix since fixing it makes things worse in the internals again
nicoddemus commentedon Nov 28, 2017
@RonnyPfannschmidt I agree, doesn't seem like something we want to actually fix, at least not in its current form where it was working by accident rather than by design.
@popravich when you can please let us know if the workaround worked for you.
argaen commentedon Nov 29, 2017
I just found out about this today. Is it worth it to at least add a disclaimer somehow in the CHANGELOG? Our deployment to PROD was skipping some tests without us even noticing so I believe its something worth to comment.
popravich commentedon Nov 29, 2017
@nicoddemus, the suggested code works with a tiny fix
def pytest_configure(config): class DynamicFixturePlugin(object): @pytest.fixture(scope='session', params=config.getoption('--servers'), ids=...) - def server_bin(request): + def server_bin(self, request): return request.param config.pluginmanager.register(DynamicFixturePlugin(), 'server-bin-fixture')And I'm +1 to @argaen about some notes in CHANGELOG.
Add CHANGELOG entry about pytest.fixture "params" being now immutable
nicoddemus commentedon Nov 29, 2017
@argaen and @popravich agree, thanks for the suggestion: #2980