Skip to content

Commit

Permalink
Fix DeprecationWarnings
Browse files Browse the repository at this point in the history
  • Loading branch information
karls committed Jul 1, 2024
1 parent 0a97b45 commit 98daa83
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/test_collectors.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import json
import time
from datetime import datetime, timedelta
from datetime import datetime, timedelta, timezone
from typing import List
from unittest.mock import Mock

Expand Down Expand Up @@ -359,7 +359,8 @@ def test_collect(self, worker_1):
redis.hgetall.return_value = {
# Simulate a job that was enqueued 1 minute ago
b"enqueued_at": rq_utils.utcformat(
datetime.utcnow() - timedelta(minutes=1)
datetime.now(tz=timezone.utc).replace(tzinfo=None)
- timedelta(minutes=1)
).encode(),
# Job origin has to match the queue name
b"origin": b"foo",
Expand All @@ -381,7 +382,8 @@ def test_collect_with_busy_job_tracking(self, worker_1, monkeypatch):
redis.hgetall.return_value = {
# Simulate a job that was enqueued 1 minute ago
b"enqueued_at": rq_utils.utcformat(
datetime.utcnow() - timedelta(minutes=1)
datetime.now(tz=timezone.utc).replace(tzinfo=None)
- timedelta(minutes=1)
).encode(),
# Job origin has to match the queue name
b"origin": b"foo",
Expand Down

0 comments on commit 98daa83

Please sign in to comment.