HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Users/fred/anaconda3/Lib/site-packages/imblearn/utils/tests/test_deprecation.py
"""Test for the deprecation helper"""

# Authors: Guillaume Lemaitre <[email protected]>
# License: MIT

import pytest

from imblearn.utils.deprecation import deprecate_parameter


class Sampler:
    def __init__(self):
        self.a = "something"
        self.b = "something"


def test_deprecate_parameter():
    with pytest.warns(FutureWarning, match="is deprecated from"):
        deprecate_parameter(Sampler(), "0.2", "a")
    with pytest.warns(FutureWarning, match="Use 'b' instead."):
        deprecate_parameter(Sampler(), "0.2", "a", "b")