New issue 50: cached_setup needs to cache correctly
http://bitbucket.org/hpk42/py-trunk/issue/50/cached_setup-needs-to-cache-correctly

holger krekel / hpk42 on Mon, 28 Sep 2009 19:49:42 +0200:

Description:
  Ronny pointed out that cached_setup does not work how one might assume: 
{{{
#!python
def pytest_funcarg__one(request):
      return request.cached_setup(lambda: 42)
def pytest_funcarg__two(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. 

Responsible:
  hpk42
-- 
This is an issue notification from bitbucket.org.
You are receiving this either because you are the
owner of the issue, or you are following the issue.
_______________________________________________
py-dev mailing list
py-dev@codespeak.net
http://codespeak.net/mailman/listinfo/py-dev

Reply via email to