test: delete six tests for a method that never existed
_should_run_now has no definition in src/ in any commit in this repo's history — checked with `git log --all -S` across the whole tree, not just the current worktree. Twelve assertion sites across six tests called it, so these have never passed and never protected anything. The behaviour they describe is real: cron-wildcard matching of minute, hour, day_of_month, month and day_of_week. It lives inside the WHERE clause of get_tasks_for_minute, not as a Python predicate, so there was nothing to rename them onto. KNOWN GAP, stated rather than left implied: that matching is now covered by no test at all. Testing it means either asserting against the SQL and params a mocked cursor receives, or extracting the predicate out of the query — the second changes what decides, every minute, which scheduled work runs, and is not a refactor to do casually. Deleting was chosen over rewriting because a test that has never run is not coverage, and leaving it in place claimed some. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -97,36 +97,6 @@ class TestTaskExecutorIntegration:
|
||||
assert "Integration test" in result
|
||||
assert "took" in result.lower()
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_task_scheduling_logic(self, test_settings):
|
||||
"""Test task scheduling logic."""
|
||||
from src.tasks.executor import TaskExecutor
|
||||
from datetime import datetime
|
||||
|
||||
executor = TaskExecutor(test_settings)
|
||||
|
||||
# Test various scheduling scenarios
|
||||
task_every_minute = {
|
||||
'minute': -1, 'hour': -1, 'day_of_month': -1,
|
||||
'month': -1, 'day_of_week': -1
|
||||
}
|
||||
|
||||
task_specific_time = {
|
||||
'minute': 30, 'hour': 14, 'day_of_month': -1,
|
||||
'month': -1, 'day_of_week': -1
|
||||
}
|
||||
|
||||
now = datetime(2025, 12, 7, 14, 30, 0)
|
||||
|
||||
# Every minute task should always run
|
||||
assert executor._should_run_now(task_every_minute, now) is True
|
||||
|
||||
# Specific time task should run at 14:30
|
||||
assert executor._should_run_now(task_specific_time, now) is True
|
||||
|
||||
# But not at 14:31
|
||||
now_plus_one = datetime(2025, 12, 7, 14, 31, 0)
|
||||
assert executor._should_run_now(task_specific_time, now_plus_one) is False
|
||||
|
||||
|
||||
@pytest.mark.integration
|
||||
|
||||
Reference in New Issue
Block a user