← Back to team overview

launchpad-dev team mailing list archive

Re: database layer resetting sequences & cronjob tests

 

On Fri, Oct 1, 2010 at 1:59 AM, Curtis Hovey <curtis.hovey@xxxxxxxxxxxxx> wrote:
> On Thu, 2010-09-30 at 13:02 -0500, Edwin Grubbs wrote:
>>
>> I see that I can set DatabaseLayer._reset_between_tests to False. Is
>> this the preferred way to solve this problem?
>
> I recall adding lots of
>    self.layer.force_dirty_database()
> to tearDown() methods a few years ago to ensure the layer was cleaned
> up.

Right. The database is not reset if the test runner thinks it is
clean, but database changes made by child processes are not detected.
So you need to explicitly inform the test infrastructure that the
database is being modified. The alternative, until we can come up with
a brilliant way of detecting changes better, is a much slower test
suite that resets the database fully after each and every test.




-- 
Stuart Bishop <stuart@xxxxxxxxxxxxxxxx>
http://www.stuartbishop.net/



Follow ups

References