cached_setup needs to cache correctly

Create issue
Issue #50 resolved
Holger Krekel repo owner created an issue

Ronny pointed out that cached_setup does not work how one might assume: {{{ #!python def pytest_funcargone(request): return request.cached_setup(lambda: 42) def pytest_funcargtwo(request): return request.cached_setup(lambda: 17) def test_hello(one, two): # one and two will both be 42! }}}

this is because the 'request' object is re-used across all function argument setups and the funcarg name is not stored on it. Needs to be better document or fixed - likely adding 'funcargname' as a key is the best approach even if it complicates the implemnetation a bit.

Comments (2)

  1. Log in to comment