Skip to content

Commit 9e92bb5

Browse files
Kyon Leeauvipy
authored andcommitted
fix(tests): correct assertion in excluded hours test
The test_get_excluded_hours_for_crontab_tasks method had assertions for excluded hours that could fail depending on the test execution time. We can only guarantee what hours are not returned by test_get_excluded_hours_for_crontab_tasks and have amended the test to do so.
1 parent a70a9dc commit 9e92bb5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

t/unit/test_schedulers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -540,8 +540,7 @@ def test_get_excluded_hours_for_crontab_tasks(self):
540540
assert str(now_hour) not in excluded_hours
541541
assert str((now_hour + 1) % 24) not in excluded_hours
542542
assert str((now_hour - 1) % 24) not in excluded_hours
543-
assert str((now_hour + 2) % 24) in excluded_hours
544-
assert str((now_hour - 2) % 24) in excluded_hours
543+
assert str(4) not in excluded_hours
545544

546545
def test_schedule_changed(self):
547546
self.m2.args = '[16, 16]'

0 commit comments

Comments
 (0)