Re: Fix time zone dependent tests

Mikko Varri <vmj-Jp3n8lUXroQxHbG02/[email protected]> Fri, 8 Apr 2011 03:50:56 +0300
Newsgroups gmane.comp.web.pyblosxom.devel
Message-ID <[email protected]>
On Thu, Apr 07, 2011 at 07:46:31PM -0400, will kahn-greene wrote:
> I'm really sorry that it took so long.
> 

No problem at all.

> 
> 8edfe5b:
> 
> The __force_tz and __restore_tz should be put in a decorator.  So if the
> test fails at set_time, we're not put in a weird situation where
> __force_tz has changed the environment, but __restore_tz never gets run.
> 
> So then tests that need tz forced would be decorated.
> 

Sounds good.

I wrote it like that to minimize the "scope" of forced time zone (in
the hopes that it would be clear which part of the test needs it).

But you're right, if set_time ever raises an exception, time zone
wouldn't be restored.

If you have a chance, feel free to write the decorators.  Otherwise,
I'll probably do it tomorrow or so and ping you again.

> 
> c09e5e83:
> 
> This one puzzles me.  The added comment is good.  However, the other
> change is moving the w3cdate.  w3cdate is built off of the gmtuple which
> is based in GMT.  Are you positive there's a problem here?  Can you
> write a unit test that shows the problem?
> 
> 

Actually, there was no problem.  I just moved it so that the comment
about locale dependency would refer to rfc822date alone.  w3cdate
format does not have anything but digits, so unless I'm mistaken it is
not locale dependent.

Only 8edfe5b was about fixing anything, the rest was about clearing up
what code is locale dependent, what code is time zone dependent, and
what code is generic.

Feel free to ignore this change if you think it has no value.  I don't
mind.


-vmj

------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev