Control: tags -1 + patch

Hi schedule maintainers,

I prepared a patch fixing the present issue in attachment
(assuming I don't screw up my email); I also informed
upstream[1], although they didn't seem very active in the past
year.  Instead of assuming tests are alway run on office hours,
I make sure the deadline is one hour ago.  The test should be
much more robust to fully automated QA/CI tasks in such
configuration.

[1]: https://github.com/dbader/schedule/pull/563

Have a nice day,  :)
-- 
Étienne Mollier <emoll...@emlwks999.eu>
Fingerprint:  8f91 b227 c7d6 f2b1 948c  8236 793c f67e 8f0d 11da
Sent from /dev/pts/1, please excuse my verbosity.
On air: Gilgamesh - One End More / Phils Little Dance - For Phi…
Description: fix test failure when run early
 Since introduction of the "until" job scheduling method to apply deadlines,
 the test_until_time fails when run between midnight and 5am local hour.
 This patch ought to ensure the deadline is always one hour ago independently
 of the time of the day, or night.
Author: Étienne Mollier <emoll...@debian.org>
Bug: https://github.com/dbader/schedule/issues/488
Bug-Debian: https://bugs.debian.org/1030455
Forwarded: https://github.com/dbader/schedule/pull/563
Last-Update: 2023-02-15
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- schedule-1.1.0.orig/test_schedule.py
+++ schedule-1.1.0/test_schedule.py
@@ -314,7 +314,8 @@
         self.assertRaises(
             ScheduleValueError, every().day.until, datetime.timedelta(minutes=-1)
         )
-        self.assertRaises(ScheduleValueError, every().day.until, datetime.time(hour=5))
+        one_hour_ago = datetime.datetime.now() - datetime.timedelta(hours=1)
+        self.assertRaises(ScheduleValueError, every().day.until, one_hour_ago)
 
         # Unschedule job after next_run passes the deadline
         schedule.clear()

Attachment: signature.asc
Description: PGP signature

Reply via email to