Skip to content

Commit

Permalink
Issue 24773: Make zoneinfo tests more robust. (reapply)
Browse files Browse the repository at this point in the history
  • Loading branch information
abalkin committed Jul 25, 2016
1 parent c74fb9c commit 95f7b9f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Lib/test/datetimetester.py
Original file line number Diff line number Diff line change
Expand Up @@ -4677,7 +4677,10 @@ class ZoneInfoTest(unittest.TestCase):
def setUp(self):
if sys.platform == "win32":
self.skipTest("Skipping zoneinfo tests on Windows")
self.tz = ZoneInfo.fromname(self.zonename)
try:
self.tz = ZoneInfo.fromname(self.zonename)
except FileNotFoundError as err:
self.skipTest("Skipping %s: %s" % (self.zonename, err))

def assertEquivDatetimes(self, a, b):
self.assertEqual((a.replace(tzinfo=None), a.fold, id(a.tzinfo)),
Expand Down Expand Up @@ -4738,7 +4741,7 @@ def test_system_transitions(self):
# civil time was generally not solar time in those years.
self.zonename.startswith('right/')):
self.skipTest("Skipping %s" % self.zonename)
tz = ZoneInfo.fromname(self.zonename)
tz = self.tz
TZ = os.environ.get('TZ')
os.environ['TZ'] = self.zonename
try:
Expand Down

0 comments on commit 95f7b9f

Please sign in to comment.