def test_test_is_deprecated_kwargs(keyword):
    assert (_is_deprecated_attribute(keyword, "kw_arg2", (DummyClass(), ),
                                     ("kw_arg2", )) is True)
    assert _is_deprecated_attribute(keyword, "kw_arg2", (DummyClass(), ),
                                    ()) is False
    assert (_is_deprecated_attribute(keyword, "kw_arg2", (DummyClass(), ),
                                     ("kw_arg1", )) is False)
Ejemplo n.º 2
0
def test_test_is_deprecated_args(keyword):
    assert _is_deprecated_attribute(keyword, "arg1", (DummyClass(), True), ()) is True
    assert (
        _is_deprecated_attribute(keyword, "arg2", (DummyClass(), True, True), ())
        is True
    )
Ejemplo n.º 3
0
def test_is_deprecated_no_deprecate_usage(keyword):
    assert _is_deprecated_attribute(keyword, "arg2", (DummyClass(),), ()) is False
    assert _is_deprecated_attribute(keyword, "arg2", (DummyClass(), True), ()) is False
Ejemplo n.º 4
0
def test_is_deprecated_no_deprecate(keyword):
    assert _is_deprecated_attribute(keyword, False, (DummyClass(),), ()) is False