Alexander Belopolsky <belopol...@users.sourceforge.net> added the comment:

On Sat, Jan 29, 2011 at 4:45 PM, Joe Peterson <rep...@bugs.python.org> wrote:
..
> I have added code that sets the TZ to one that works, and then reverts the 
> temporary
> TZ change after the test.
>

Your test will not restore TZ if it fails.  This is not nice.  To fix
that, code restoring the TZ should go into a finally clause.  Even
better, set TZ in a setUp() method and restore it in a tearDown()
method of the test case class.  Ultimately, if you want to be fancy,
take a look at the @run_with_locale decorator defined in
Lib/test/support.py.  We may have more than one use for @run_with_tz.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10941>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to