Skip to content

Commit

Permalink
Fix test_until_time failure when run early (#563)
Browse files Browse the repository at this point in the history
  • Loading branch information
emollier committed Apr 9, 2023
1 parent a5036cf commit a3ecd35
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,8 @@ def test_until_time(self):
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()
Expand Down

0 comments on commit a3ecd35

Please sign in to comment.