Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Changed setUp and tearDown for the tests converted from doctests in r…


to not assume TZ absolutely will be set in the environment.  That environment
variable does not necessarily exist on Windows, it seems.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit d4bb582b1a11edb28ab239fe1b7c6104d24a8e73 1 parent ff38e0b
@kmtracey kmtracey authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 tests/regressiontests/utils/
7 tests/regressiontests/utils/
@@ -6,11 +6,14 @@
class DateFormatTests(TestCase):
def setUp(self):
- self.old_TZ = os.environ['TZ']
+ self.old_TZ = os.environ.get('TZ')
os.environ['TZ'] = 'Europe/Copenhagen'
def tearDown(self):
- os.environ['TZ'] = self.old_TZ
+ if self.old_TZ is None:
+ del os.environ['TZ']
+ else:
+ os.environ['TZ'] = self.old_TZ
def test_date(self):
d = date(2009, 5, 16)
Please sign in to comment.
Something went wrong with that request. Please try again.