diff options
author | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2016-07-23 15:16:56 (GMT) |
---|---|---|
committer | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2016-07-23 15:16:56 (GMT) |
commit | 8dadb2155bbb05bf29b3c5a315d0c9a9eb4d865e (patch) | |
tree | 1a90495556c466b4a33c4b8a719807e4c35c3fe4 /Lib | |
parent | 1f7480a67ee4221d928cbecb1e45b3aae78df4a9 (diff) | |
download | cpython-8dadb2155bbb05bf29b3c5a315d0c9a9eb4d865e.zip cpython-8dadb2155bbb05bf29b3c5a315d0c9a9eb4d865e.tar.gz cpython-8dadb2155bbb05bf29b3c5a315d0c9a9eb4d865e.tar.bz2 |
Issue 24773: Make zoneinfo tests more robust.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/datetimetester.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py index e0d23da..3ffafa7 100644 --- a/Lib/test/datetimetester.py +++ b/Lib/test/datetimetester.py @@ -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)), @@ -4738,7 +4741,7 @@ class ZoneInfoTest(unittest.TestCase): # 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: |