import warnings


def ignore_warnings(test_func):
    """Decorator to ignore specific warnings during unittesting"""

    """
    Returns:
        do_test: The input function 'test_func' in decorated form to
                 approrpriately handle resource warnings
    """
    def do_test(self, *args, **kwargs):
        with warnings.catch_warnings():
            """File I/O is known to raise ResourceWarning in
            unittest so ignore it"""
            warnings.simplefilter("ignore", ResourceWarning)
            test_func(self, *args, **kwargs)
    return do_test