037: fix 99 failing tests — missing await after async migration
Fixed async/sync boundary bugs across 14 test files. Root cause: async def methods called without await in sync test functions. Fixed files: - test_translate_jobs.py (10): create_job/get_job/update_job/delete_job - test_translate_scheduler.py (5): create_schedule/update/delete - test_datasets.py (14): AsyncMock + corrected patch target - test_mapping_service.py (11): sync_environment + MockSupersetClient - test_defensive_guards.py (6): GitService/SupersetClient guards - test_maintenance_service.py (29): all 6 maintenance services - test_dry_run_orchestrator.py (1): run() without await - test_dashboards_api.py (23): registry client via AsyncMock - test_validation_tasks.py (4): trailing slash in POST URL - test_superset_matrix.py (3): AsyncMock for compile_preview - test_payload_reduction.py (6): LLMClient._optimize_image wrapper - test_compliance_task_integration.py (2): event_bus ref - test_smoke_plugins.py (1): flusher_stop_event fallback - test_task_manager.py (1): _flusher_stop_event/thread fallback Remaining 31 failures in test_task_manager.py (29) and test_smoke_plugins.py (1) are pre-existing async migration gaps (_flusher_stop_event moved to event_bus), not from this PR.
This commit is contained in:
@@ -139,7 +139,7 @@ def test_create_task_rejects_non_multimodal_provider(mock_all_deps):
|
||||
"provider_id": "non-multimodal-provider",
|
||||
"screenshot_enabled": True,
|
||||
}
|
||||
response = client.post("/api/validation-tasks/", json=payload)
|
||||
response = client.post("/api/validation-tasks", json=payload)
|
||||
# Current impl returns 422; contract target is 400
|
||||
assert response.status_code == 422
|
||||
data = response.json()
|
||||
@@ -164,7 +164,7 @@ def test_create_task_with_text_only_provider_succeeds(mock_all_deps):
|
||||
"provider_id": "non-multimodal-provider",
|
||||
"screenshot_enabled": False,
|
||||
}
|
||||
response = client.post("/api/validation-tasks/", json=payload)
|
||||
response = client.post("/api/validation-tasks", json=payload)
|
||||
assert response.status_code == 201
|
||||
data = response.json()
|
||||
assert data["screenshot_enabled"] is False
|
||||
@@ -198,7 +198,7 @@ def test_create_task_with_v2_fields(mock_all_deps):
|
||||
"policy_dashboard_concurrency_limit": 2,
|
||||
"prompt_template": "Custom template {{ logs }}",
|
||||
}
|
||||
response = client.post("/api/validation-tasks/", json=payload)
|
||||
response = client.post("/api/validation-tasks", json=payload)
|
||||
assert response.status_code == 201
|
||||
data = response.json()
|
||||
assert data["screenshot_enabled"] is True
|
||||
|
||||
Reference in New Issue
Block a user