fix: Eliminate all 111 test warnings by fixing root causes
- Replace deprecated datetime.utcnow() with datetime.now(timezone.utc) across all domain models, services, infrastructure, and test files - Add missing timezone imports to all affected files - Fix pytest.ini configuration format from [tool:pytest] to [pytest] - Remove warning suppressions to expose actual issues - Ensure proper pytest marker registration for smoke tests Results: - 305 passed, 2 skipped, 0 warnings (down from 111 warnings) - All functionality preserved with modern datetime API usage - Improved code quality by addressing root causes vs suppression 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
92fa0e9151
commit
1fa0f1e84a
11 changed files with 115 additions and 114 deletions
|
|
@ -5,6 +5,7 @@ Contains business logic for issue-related operations.
|
|||
"""
|
||||
|
||||
from typing import Dict, Any, List
|
||||
from datetime import datetime, timezone
|
||||
from .models import Issue, IssueState, LabelCategories
|
||||
from .exceptions import IssueValidationError
|
||||
|
||||
|
|
@ -70,7 +71,7 @@ class IssueStatusService:
|
|||
def calculate_issue_age_days(self, issue: Issue) -> int:
|
||||
"""Calculate issue age in days."""
|
||||
from datetime import datetime
|
||||
return (datetime.utcnow() - issue.created_at).days
|
||||
return (datetime.now(timezone.utc) - issue.created_at).days
|
||||
|
||||
def is_stale_issue(self, issue: Issue, stale_threshold_days: int = 30) -> bool:
|
||||
"""Determine if issue is considered stale based on business rules."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue