Skip to content

fix(tests): correct assertion in excluded hours test#858

Merged
auvipy merged 1 commit intocelery:mainfrom
kyonlee:fix/test-get-excluded-hours
Mar 22, 2025
Merged

fix(tests): correct assertion in excluded hours test#858
auvipy merged 1 commit intocelery:mainfrom
kyonlee:fix/test-get-excluded-hours

Conversation

@kyonlee
Copy link
Copy Markdown

@kyonlee kyonlee commented Mar 21, 2025

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.

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.
@kyonlee
Copy link
Copy Markdown
Author

kyonlee commented Mar 21, 2025

When the test is executed on the 2nd or 6th hour, the assertions checking now_hour + 2 and now_hour - 2 are in excluded_hours will fail respectively, because "4" and "04" are always removed from excluded_hours.

I have removed these assertions and have added one to verify that "4" and "04" is not in excluded_hours.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.73%. Comparing base (a70a9dc) to head (7f4b987).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #858      +/-   ##
==========================================
+ Coverage   87.42%   87.73%   +0.31%     
==========================================
  Files          32       32              
  Lines         954      954              
  Branches       76       76              
==========================================
+ Hits          834      837       +3     
+ Misses        102      100       -2     
+ Partials       18       17       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@auvipy auvipy merged commit 9e92bb5 into celery:main Mar 22, 2025
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants