This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Skip test_variable_tzname when the zoneinfo database is missing
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.3, Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ezio.melotti Nosy List: belopolsky, ezio.melotti, python-dev, r.david.murray
Priority: normal Keywords: patch

Created on 2013-04-30 09:07 by ezio.melotti, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
olson.diff ezio.melotti, 2013-04-30 09:07 review
Messages (3)
msg188145 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2013-04-30 09:07
If the Olson/zoneinfo/tz database is missing, test_variable_tzname fails:

[1/1] test_email
Warning -- sys.path was modified by test_email
test test_email failed -- Traceback (most recent call last):
  File "/usr/local/lib/python3.3/test/support.py", line 1311, in inner
    return func(*args, **kwds)
  File "/usr/local/lib/python3.3/test/test_email/test_utils.py", line 133, in test_variable_tzname
    self.assertEqual(t1.tzname(), 'MSK')
AssertionError: 'Europe' != 'MSK'
- Europe
+ MSK

The attached patch checks if /usr/share/zoneinfo or /usr/lib/zoneinfo exist, and skip the test if they don't.  This test is already skipped on Windows.
msg188708 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2013-05-08 08:15
> The attached patch checks if /usr/share/zoneinfo or /usr/lib/zoneinfo exist

FTR these two locations are described by `man tzfile`:
"""
This page describes the structure of the timezone files used by tzset(3).  These files are typically found under one of the directories
/usr/lib/zoneinfo or /usr/share/zoneinfo.
"""
msg188709 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-05-08 08:16
New changeset f7b552020d44 by Ezio Melotti in branch '3.3':
#17877: skip test if the Olson's TZ database is missing.
http://hg.python.org/cpython/rev/f7b552020d44

New changeset 492eba054e59 by Ezio Melotti in branch 'default':
#17877: merge with 3.3.
http://hg.python.org/cpython/rev/492eba054e59
History
Date User Action Args
2022-04-11 14:57:45adminsetgithub: 62077
2013-05-08 08:17:24ezio.melottisetstatus: open -> closed
resolution: fixed
stage: commit review -> resolved
2013-05-08 08:16:54python-devsetnosy: + python-dev
messages: + msg188709
2013-05-08 08:15:03ezio.melottisetmessages: + msg188708
2013-05-04 17:16:50ezio.melottisetassignee: ezio.melotti
stage: patch review -> commit review
2013-04-30 09:07:33ezio.melotticreate