[Python-modules-commits] [parsedatetime] 02/04: Fix delta test by using a static source time

Brian May bam at moszumanska.debian.org
Sat Mar 11 00:54:17 UTC 2017


This is an automated email from the git hooks/post-receive script.

bam pushed a commit to branch master
in repository parsedatetime.

commit 56980ebc6028b129adfa8b359b03247de82c9a3c
Author: Brian May <bam at debian.org>
Date:   Sat Mar 11 11:44:54 2017 +1100

    Fix delta test by using a static source time
    
    Apply patch from upstream:
    https://github.com/bear/parsedatetime/commit/76a97697e3611356b848f0aa7c759ff80fd7bd4c
    
    Without this patch, the tests would fail immediately after February, as
    February only has 28 days, and the tests currently assume months have 30
    days.
    
    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=856625
    https://github.com/bear/parsedatetime/issues/215
---
 tests/TestDelta.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/tests/TestDelta.py b/tests/TestDelta.py
index c628d5e..a54aee1 100644
--- a/tests/TestDelta.py
+++ b/tests/TestDelta.py
@@ -13,9 +13,7 @@ class test(unittest.TestCase):
 
     def setUp(self):
         self.cal = pdt.Calendar(version=pdt.VERSION_CONTEXT_STYLE)
-        self.source = (self.yr, self.mth, self.dy,
-                       self.hr, self.mn, self.sec,
-                       self.wd, self.yd, self.isdst) = time.localtime()
+        self.source = (2017, 1, 1, 7, 1, 2, 6, 1, 1)
 
     def assertDelta(self, ts, years=None, months=None, **deltakw):
         ts = ts[0]

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/parsedatetime.git



More information about the Python-modules-commits mailing list