Edgewall Software
Modify

Opened 7 years ago

Closed 7 years ago

#12978 closed defect (fixed)

Test failure with pytz 2018.3

Reported by: Ryan J Ollos Owned by: Jun Omae
Priority: normal Milestone: 1.0.17
Component: general Version:
Severity: normal Keywords: pytz
Cc: Branch:
Release Notes:

Remove unit tests which fails when pytz is 2018c and tzdata package is not 2018c.

API Changes:
Internal Changes:

Description

======================================================================
FAIL: test_pytz_tokyo (trac.util.tests.datefmt.LocalTimezoneTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/util/tests/datefmt.py", line 2050, in test_pytz_tokyo
    self._compare_pytz(tz, '1948-05-02T02:00')  # +1:00 (DST start)
  File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/util/tests/datefmt.py", line 1965, in _compare_pytz
    self._compare_pytz_arithmetic(tz, dt_naive)
  File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/util/tests/datefmt.py", line 1929, in _compare_pytz_arithmetic
    self.assertEqual(dt_tz.isoformat(), dt_localtz.isoformat())
AssertionError: '1948-05-02T01:00:00+10:00' != '1948-05-02T00:00:00+09:00'

Attachments (0)

Change History (3)

comment:1 by Jun Omae, 7 years ago

Owner: set to Jun Omae
Status: newassigned

If tzdata version between pytz and debian package is same, the unit test passes.

I'm considering whether we modify/remove the unit test.

root@24ba7ff3e274:/tmp/trac-1.0-stable# COLUMNS=80 dpkg --list tzdata
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  tzdata         2018c-1      all          time zone and daylight-saving tim
root@24ba7ff3e274:/tmp/trac-1.0-stable# PATH="/tmp/t12978/bin:$PATH" make trac/util/tests/datefmt.py
 It looks like you don't have a Makefile.cfg file yet.
 You can get started by doing `cp Makefile.cfg.sample Makefile.cfg'
 and then adapt it to your environment.

Python: /tmp/t12978/bin/python

  Package        Version
  --------------------------------------------------------
  Python       : 2.7.14+ (default, Feb  6 2018, 19:12:18)
               : [GCC 7.3.0]
  Setuptools   : 38.5.1
  Pip          : 9.0.1
  Wheel        : 0.29.0
  Genshi       : 0.7 (without speedups)
  Babel        : not installed
  sqlite3      : 2.6.0 (3.22.0)
  PySqlite     : not installed
  MySQLdb      : not installed
  Psycopg2     : not installed
  SVN bindings : not installed
  Mercurial    : not installed
  Pygments     : not installed
  Textile      : not installed
  Pytz         : 2018.3
  ConfigObj    : not installed
  Docutils     : not installed
  Twill        : not installed
  LXML         : not installed
  coverage     : not installed
  figleaf      : not installed

Variables:
  PATH=/tmp/t12978/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
  PYTHONPATH=.
  TRAC_TEST_DB_URI=
  server-options= -p 8000  -r -e

External dependencies:
  Git version: not installed
  Subversion version: 1.9.7

python setup.py -q test -s trac.util.tests.datefmt.suite
SKIP: fine-grained permission tests (ConfigObj not installed)
SKIP: utils/tests/datefmt.py (no babel installed)
.................................................................................................................
----------------------------------------------------------------------
Ran 113 tests in 0.220s

OK

comment:2 by Jun Omae, 7 years ago

In https://github.com/eggert/tz/commit/bbd0ea690201acab766db57142f9aa0abba30613, Asia/Tokyo DST transition times are changed from 2018b to 2018c. Ideally, we should invoke the unit tests to compare LocalTimezone and pytz's timezone if tzdata versions are same in between pytz and libc. However, no way to retrieve tzdata version in libc.

Therefore, I'll remove LocalTimezoneTestCase.test_pytz_tokyo.

Last edited 7 years ago by Jun Omae (previous) (diff)

comment:3 by Jun Omae, 7 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Fixed in [16431] and merged in [16432-16433].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jun Omae to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.