

def assertWarning(self, warning, callable, *args, **kwargs):
    with warnings.catch_warnings(record=True) as warning_list:
        warnings.simplefilter(action='always')
        callable(*args, **kwargs)
        self.assertTrue(any(((item.category == warning) for item in warning_list)))

dataset/ETHPy150Open inonit/drf-haystack/tests/mixins.py WarningTestCaseMixin.assertWarning/original