Skip to content

Commit

Permalink
Merge PR OCA#728 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by simahawk
  • Loading branch information
OCA-git-bot committed Jan 28, 2025
2 parents a77575e + 1ddc4c8 commit 24d9d2b
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion base_export_async/tests/test_base_export_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

class TestBaseExportAsync(common.TransactionCase):
def setUp(self):
super(TestBaseExportAsync, self).setUp()
super().setUp()
self.delay_export_obj = self.env["delay.export"]
self.job_obj = self.env["queue.job"]
_request_stack.push(
Expand Down
2 changes: 1 addition & 1 deletion queue_job/delay.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ def _execute_direct(self):
self._generated_job.perform()


class DelayableRecordset(object):
class DelayableRecordset:
"""Allow to delay a method for a recordset (shortcut way)
Usage::
Expand Down
2 changes: 1 addition & 1 deletion queue_job/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def identity_exact_hasher(job_):


@total_ordering
class Job(object):
class Job:
"""A Job is a task to execute. It is the in-memory representation of a job.
Jobs are stored in the ``queue.job`` Odoo Model, but they are handled
Expand Down
10 changes: 5 additions & 5 deletions queue_job/jobrunner/channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
_logger = logging.getLogger(__name__)


class PriorityQueue(object):
class PriorityQueue:
"""A priority queue that supports removing arbitrary objects.
Adding an object already in the queue is a no op.
Expand Down Expand Up @@ -103,7 +103,7 @@ def pop(self):


@total_ordering
class ChannelJob(object):
class ChannelJob:
"""A channel job is attached to a channel and holds the properties of a
job that are necessary to prioritise them.
Expand Down Expand Up @@ -205,7 +205,7 @@ def __lt__(self, other):
return self.sorting_key() < other.sorting_key()


class ChannelQueue(object):
class ChannelQueue:
"""A channel queue is a priority queue for jobs.
Jobs with an eta are set aside until their eta is past due, at
Expand Down Expand Up @@ -334,7 +334,7 @@ def get_wakeup_time(self, wakeup_time=0):
return wakeup_time


class Channel(object):
class Channel:
"""A channel for jobs, with a maximum capacity.
When jobs are created by queue_job modules, they may be associated
Expand Down Expand Up @@ -581,7 +581,7 @@ def split_strip(s, sep, maxsplit=-1):
return [x.strip() for x in s.split(sep, maxsplit)]


class ChannelManager(object):
class ChannelManager:
"""High level interface for channels
This class handles:
Expand Down
4 changes: 2 additions & 2 deletions queue_job/jobrunner/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def urlopen():
thread.start()


class Database(object):
class Database:
def __init__(self, db_name):
self.db_name = db_name
connection_info = _connection_info_for(db_name)
Expand Down Expand Up @@ -344,7 +344,7 @@ def set_job_enqueued(self, uuid):
)


class QueueJobRunner(object):
class QueueJobRunner:
def __init__(
self,
scheme="http",
Expand Down
2 changes: 1 addition & 1 deletion queue_job/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def __init__(

def setUp(self):
"""Log an extra statement which test is started."""
super(OdooDocTestCase, self).setUp()
super().setUp()
logging.getLogger(__name__).info("Running tests for %s", self._dt_test.name)


Expand Down
2 changes: 1 addition & 1 deletion queue_job_subscribe/tests/test_job_subscribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class TestJobSubscribe(common.TransactionCase):
def setUp(self):
super(TestJobSubscribe, self).setUp()
super().setUp()
grp_queue_job_manager = self.ref("queue_job.group_queue_job_manager")
self.other_partner_a = self.env["res.partner"].create(
{"name": "My Company a", "is_company": True, "email": "[email protected]"}
Expand Down
2 changes: 1 addition & 1 deletion test_queue_job/models/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def job_with_retry_pattern__no_zero(self):
return

def mapped(self, func):
return super(ModelTestQueueJob, self).mapped(func)
return super().mapped(func)

def job_alter_mutable(self, mutable_arg, mutable_kwarg=None):
mutable_arg.append(2)
Expand Down
4 changes: 2 additions & 2 deletions test_queue_job/tests/test_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def test_infinite_retryable_error(self):
self.assertEqual(test_job.retry, 1)

def test_on_instance_method(self):
class A(object):
class A:
def method(self):
pass

Expand Down Expand Up @@ -651,7 +651,7 @@ class TestJobStorageMultiCompany(common.TransactionCase):
"""Test storage of jobs"""

def setUp(self):
super(TestJobStorageMultiCompany, self).setUp()
super().setUp()
self.queue_job = self.env["queue.job"]
grp_queue_job_manager = self.ref("queue_job.group_queue_job_manager")
User = self.env["res.users"]
Expand Down
2 changes: 1 addition & 1 deletion test_queue_job/tests/test_job_channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class TestJobChannels(common.TransactionCase):
def setUp(self):
super(TestJobChannels, self).setUp()
super().setUp()
self.function_model = self.env["queue.job.function"]
self.channel_model = self.env["queue.job.channel"]
self.test_model = self.env["test.queue.channel"]
Expand Down
2 changes: 1 addition & 1 deletion test_queue_job/tests/test_job_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class TestJobFunction(common.TransactionCase):
def setUp(self):
super(TestJobFunction, self).setUp()
super().setUp()
self.test_function_model = self.env.ref(
"queue_job.job_function_queue_job__test_job"
)
Expand Down

0 comments on commit 24d9d2b

Please sign in to comment.