'Ensure deprecated_call() captures a deprecation warning as expected inside its
block/function.'

@pytest.mark.parametrize('warning_type', [PendingDeprecationWarning, DeprecationWarning])
@pytest.mark.parametrize('mode', ['context_manager', 'call'])
@pytest.mark.parametrize('call_f_first', [True, False])
@pytest.mark.filterwarnings('ignore')
def test_deprecated_call_modes(self, warning_type, mode, call_f_first):

    def f():
        warnings.warn(warning_type('hi'))
        return 10
    if call_f_first:
        assert (f() == 10)
    if (mode == 'call'):
        assert (pytest.deprecated_call(f) == 10)
    else:
        with pytest.deprecated_call():
            assert (f() == 10)
