Blob Blame History Raw
From 617f7d9dfc43855df2207dcd43ca25d140bf7b46 Mon Sep 17 00:00:00 2001
From: Robert Buchholz <rbu@goodpoint.de>
Date: Fri, 4 Dec 2015 01:07:32 +0100
Subject: [PATCH] Test failure: eom is correct, but expectation is wrong

This test fails in december, because the source time of calculation (s)
is in the next year (because it is generated after yr += 1).

Upstream PR:
https://github.com/bear/parsedatetime/pull/146

---
 parsedatetime/tests/TestStartTimeFromSourceTime.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/parsedatetime/tests/TestStartTimeFromSourceTime.py b/parsedatetime/tests/TestStartTimeFromSourceTime.py
index 586bae9..8f5a1db 100644
--- a/parsedatetime/tests/TestStartTimeFromSourceTime.py
+++ b/parsedatetime/tests/TestStartTimeFromSourceTime.py
@@ -26,13 +26,12 @@ class test(unittest.TestCase):
           # to get the end of the current month
         (yr, mth, dy, hr, mn, sec, _, _, _) = s.timetuple()
 
-        m    = mth
+        s = datetime.datetime(yr, mth, dy, 13, 14, 15)
+
         mth += 1
         if mth > 12:
             mth = 1
             yr += 1
-
-        s = datetime.datetime(yr,   m, dy, 13, 14, 15)
         t = datetime.datetime(yr, mth,  1, 13, 14, 15) + datetime.timedelta(days=-1)
 
         start  = s.timetuple()
-- 
2.5.0