Skip to content

Commit

Permalink
[IMP] queue_job: Don't raise warning in tests when jobs are not delayed
Browse files Browse the repository at this point in the history
  • Loading branch information
thienvh332 committed Oct 11, 2024
1 parent b27b028 commit d308edc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion queue_job/delay.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import uuid
from collections import defaultdict, deque

from odoo.tools import config

from .job import Job
from .utils import must_run_without_delay

Expand Down Expand Up @@ -492,7 +494,10 @@ def __repr__(self):

def __del__(self):
if not self._generated_job:
_logger.warning("Delayable %s was prepared but never delayed", self)
if config.get("test_enable"):
_logger.info("Delayable %s was prepared but never delayed", self)
else:
_logger.warning("Delayable %s was prepared but never delayed", self)

Check warning on line 500 in queue_job/delay.py

View check run for this annotation

Codecov / codecov/patch

queue_job/delay.py#L500

Added line #L500 was not covered by tests

def _set_from_dict(self, properties):
for key, value in properties.items():
Expand Down

0 comments on commit d308edc

Please sign in to comment.