Skip to content

Commit

Permalink
Add deprecated warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Cristian Le <[email protected]>
  • Loading branch information
LecrisUT committed Aug 20, 2024
1 parent 0f8f444 commit f2d6af7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tmt/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import logging.handlers
import os
import sys
import warnings
from typing import (
TYPE_CHECKING,
Any,
Expand All @@ -45,6 +44,8 @@

import click

from tmt._compat.warnings import deprecated

if TYPE_CHECKING:
import tmt.cli
import tmt.utils
Expand Down Expand Up @@ -823,12 +824,12 @@ def warning(
shift=shift)
)

@deprecated("Use Logger.warning instead")
def warn(
self,
message: str,
shift: int
) -> None:
warnings.warn("Use `warning` instead", DeprecationWarning, stacklevel=1)
return self.warning(message, shift)

def fail(
Expand Down

0 comments on commit f2d6af7

Please sign in to comment.