def for_each_inlet(fn):
    """Runs the test for each inlet returned from :any:`InletTester.get_inlet`"""

    def wrapper(test_kls, *args, **kwargs):
        for inlet in test_kls.inlets:
            inlet._metadata = {**test_kls.inlet._metadata, **test_kls.gmetadata}
            test_kls.inlet = inlet
            with test_kls.subTest(msg=f"Inlet {str(inlet)}"):
                fn(test_kls, *args, **kwargs)

    return wrapper