Unverified Commit 34d1eeb0 authored by Damian Johnson's avatar Damian Johnson Committed by Philipp Winter
Browse files

Scheduling tests are timezone sensitive

This one isn't python 3 related but rather simply a BridgeDB bug when the
system's local time isn't UTC...

  Traceback (most recent call last):
    File "/home/atagar/Desktop/tor/bridgedb/bridgedb/test/test_schedule.py", line 191, in test_ScheduledInterval_getInterval_seconds
      self._check_getInterval(10, 'seconds', 60)
    File "/home/atagar/Desktop/tor/bridgedb/bridgedb/test/test_schedule.py", line 173, in _check_getInterval
      self.assertApproximates(now, secs, variance)
    File "/usr/local/lib/python3.5/dist-packages/twisted/trial/_synctest.py", line 562, in assertApproximates
      raise self.failureException(msg or "%s ~== %s" % (first, second))
  twisted.trial.unittest.FailTest: 1579475685 ~== 1579446840

Test results changed as follows...

  before: FAILED (skips=115, failures=26, successes=843)
  after:  FAILED (skips=115, failures=23, successes=846)
parent 769712e0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ def fromUnixSeconds(timestamp):
    :param int timestamp: A timestamp in Unix Era seconds.
    :rtype: :any:`datetime.datetime`
    """
    return datetime.fromtimestamp(timestamp)
    return datetime.utcfromtimestamp(timestamp)


class ISchedule(interface.Interface):