Re: Resetting cache gracefully at the end of every test?

2011-07-04 Thread Jim Dalton
On Jul 4, 2011, at 8:01 AM, Jacob Kaplan-Moss wrote: > On Mon, Jul 4, 2011 at 8:54 AM, Jim Dalton wrote: >> I've created a ticket for this and uploaded a patch: >> https://code.djangoproject.com/ticket/16401 >> Please feel free to review and let me know if this is a good

Re: Resetting cache gracefully at the end of every test?

2011-07-04 Thread Jacob Kaplan-Moss
On Mon, Jul 4, 2011 at 8:54 AM, Jim Dalton wrote: > I've created a ticket for this and uploaded a patch: > https://code.djangoproject.com/ticket/16401 > Please feel free to review and let me know if this is a good idea in the > first place, as well as if the patch makes

Re: Resetting cache gracefully at the end of every test?

2011-07-04 Thread Jim Dalton
I've created a ticket for this and uploaded a patch: https://code.djangoproject.com/ticket/16401 Please feel free to review and let me know if this is a good idea in the first place, as well as if the patch makes sense and is the right approach. Thanks, Jim -- You received this message

Re: Resetting cache gracefully at the end of every test?

2011-07-03 Thread Souen Boniface
> > I believe as a general principle that a testing framework should always > return the system under test to the state it was in prior to the run. > Calling cache.flush() violates that principle -- and of principle concern to > me, it flushes your *entire* cache. That means if someone executed

Re: Resetting cache gracefully at the end of every test?

2011-07-01 Thread Jeremy Dunck
On Fri, Jul 1, 2011 at 12:27 PM, Jim Dalton wrote: > Awesome feedback, thanks. > > On Jul 1, 2011, at 10:01 AM, Jeremy Dunck wrote: > ... >> If I were to do this, I wouldn't have cache shared between tests or >> environments, so I'd be tempted to use flush. > > I'm not

Re: Resetting cache gracefully at the end of every test?

2011-07-01 Thread Jim Dalton
Awesome feedback, thanks. On Jul 1, 2011, at 10:01 AM, Jeremy Dunck wrote: > Well, I think you forgot all the other low-level cache options, like > .incr, .add, etc.? Yep, forgot those so they would conceivably need to be tracked. > > If I were to do this, I wouldn't have cache shared between

Re: Resetting cache gracefully at the end of every test?

2011-07-01 Thread Jeremy Dunck
On Fri, Jul 1, 2011 at 10:54 AM, Jim D. wrote: > This issue came up again for me recently: Because the cache is not reset or > flushed after every test, cache values linger there. This can create > headaches when writing tests. > I would like to propose that we treat the

Resetting cache gracefully at the end of every test?

2011-07-01 Thread Jim D.
This issue came up again for me recently: Because the cache is not reset or flushed after every test, cache values linger there. This can create headaches when writing tests. I would like to propose that we treat the cache backend(s) like database backends during the test run. Specifically, I