epsilon.test.test_extime.TestTime.test_cmp relies on timezone

Bug #1268562 reported by Laurens Van Houtven
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Divmod
New
Low
Unassigned

Bug Description

See: https://bazaar.launchpad.net/~divmod-dev/divmod.org/trunk/view/head:/Epsilon/epsilon/test/test_extime.py#L70

epsilon.test.test_extime.TestTime.test_cmp produces two extime.Times using extime.Time.fromStructTime: one using time.gmtime and one using time.localtime. It asserts the two produced Times compare different. The only difference between these two functions is whether the time is local or UTC. That means the test relies on the environment's timezone. That is bad.

It's hard to tell what the test is actually trying to do, and what an appropriate difference should be. It seems self-evident from the contract of gmtime and localtime that if the time zone is not UTC, the results will be different; perhaps the assertion should just be removed entirely.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.