-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
35 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# SPDX-FileCopyrightText: 2024-present jefer94 <[email protected]> | ||
# | ||
# SPDX-License-Identifier: LGPL-3.0-or-later | ||
__version__ = "1.8.0" | ||
__version__ = "1.9.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .core import * # noqa: F401 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
"""Centralized Breathecode fixtures for all our libraries.""" | ||
|
||
from .fixtures import * # noqa: F401 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .dont_wait_for_rescheduling_tasks import * # noqa: F401 |
29 changes: 29 additions & 0 deletions
29
src/task_manager/pytest/core/fixtures/dont_wait_for_rescheduling_tasks.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from typing import Generator | ||
from unittest.mock import patch | ||
|
||
import pytest | ||
|
||
__all__ = ["dont_wait_for_rescheduling_tasks"] | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def dont_wait_for_rescheduling_tasks() -> Generator[None, None, None]: | ||
""" | ||
Don't wait for rescheduling tasks by default. | ||
You can re-enable it within a test by calling the provided wrapper. | ||
""" | ||
|
||
from task_manager.core.settings import set_settings | ||
|
||
set_settings(RETRIES_LIMIT=2) | ||
|
||
with patch( | ||
"task_manager.core.decorators.Task.reattempt_settings", | ||
lambda *args, **kwargs: dict(), | ||
): | ||
with patch( | ||
"task_manager.core.decorators.Task.circuit_breaker_settings", | ||
lambda *args, **kwargs: dict(), | ||
): | ||
yield |