Skip to content

Commit 5cac74d

Browse files
sebermpsss
authored andcommitted
Rename utils.catch_warnings to catch_warnings_safe
1 parent 6fa638f commit 5cac74d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tmt/steps/report/reportportal.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import tmt.steps.report
1313
import tmt.utils
1414
from tmt.result import ResultOutcome
15-
from tmt.utils import ActionType, catch_warnings, field, format_timestamp, yaml_to_dict
15+
from tmt.utils import ActionType, catch_warnings_safe, field, format_timestamp, yaml_to_dict
1616

1717
if TYPE_CHECKING:
1818
from tmt._compat.typing import TypeAlias
@@ -778,7 +778,7 @@ def go(self, *, logger: Optional[tmt.log.Logger] = None) -> None:
778778
self.warn("SSL verification is disabled for all requests being made to ReportPortal "
779779
f"instance ({self.data.url}).")
780780

781-
with catch_warnings(
781+
with catch_warnings_safe(
782782
action=warning_filter_action,
783783
category=urllib3.exceptions.InsecureRequestWarning):
784784
self.execute_rp_import()

tmt/utils/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6289,7 +6289,7 @@ def is_url(url: str) -> bool:
62896289

62906290

62916291
@contextlib.contextmanager
6292-
def catch_warnings(
6292+
def catch_warnings_safe(
62936293
action: ActionType,
62946294
category: type[Warning] = Warning) -> Iterator[None]:
62956295
"""
@@ -6305,7 +6305,7 @@ def catch_warnings(
63056305
63066306
.. code-block:: python
63076307
6308-
with catch_warnings('ignore', urllib3.exceptions.InsecureRequestWarning):
6308+
with catch_warnings_safe('ignore', urllib3.exceptions.InsecureRequestWarning):
63096309
...
63106310
"""
63116311
with _catch_warning_lock, warnings.catch_warnings():

0 commit comments

Comments
 (0)